Add Actor.HasScene and Script.HasScene

Useful in managed code to check the existence of the scene in hot paths
by avoiding expensive marshalling of the Scene object.
This commit is contained in:
2024-04-20 14:11:15 +03:00
parent 361e9a2929
commit 4dcdd8b5f7
7 changed files with 24 additions and 9 deletions

View File

@@ -17,6 +17,12 @@ namespace FlaxEngine
}
}
/// <summary>
/// Gets value indicating if the actor owning the script is in a scene.
/// </summary>
[HideInEditor, NoSerialize]
public bool HasScene => Actor?.HasScene ?? false;
/// <summary>
/// Gets or sets the world space transformation of the actors owning this script.
/// </summary>