From 4b6e75c0af438d79a3bd5d9c2670a16f67bf3fa3 Mon Sep 17 00:00:00 2001 From: Wojciech Figat Date: Fri, 29 Jul 2022 14:52:41 +0200 Subject: [PATCH] Expose `IsDuringPlay` property for actors and scripts to use in scripting --- Source/Engine/Content/Content.cpp | 3 +++ Source/Engine/Level/SceneObject.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Content/Content.cpp b/Source/Engine/Content/Content.cpp index 6d2e52b85..21a96edc1 100644 --- a/Source/Engine/Content/Content.cpp +++ b/Source/Engine/Content/Content.cpp @@ -166,6 +166,9 @@ void ContentService::Dispose() // Save assets registry before engine closing Cache.Save(); + // Flush objects (some asset-related objects/references may be pending to delete) + ObjectsRemovalService::Flush(); + // Unload all remaining assets { ScopeLock lock(AssetsLocker); diff --git a/Source/Engine/Level/SceneObject.h b/Source/Engine/Level/SceneObject.h index d044fe8cc..db58a71b8 100644 --- a/Source/Engine/Level/SceneObject.h +++ b/Source/Engine/Level/SceneObject.h @@ -97,7 +97,7 @@ public: /// /// Determines whether object is during play (spawned/loaded and fully initialized). /// - FORCE_INLINE bool IsDuringPlay() const + API_PROPERTY() FORCE_INLINE bool IsDuringPlay() const { return (Flags & ObjectFlags::IsDuringPlay) != 0; }