Add Script::IsEnabledInHierarchy
This commit is contained in:
@@ -63,6 +63,11 @@ void Script::SetEnabled(bool value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Script::IsEnabledInHierarchy() const
|
||||||
|
{
|
||||||
|
return _enabled && (_parent == nullptr || _parent->IsActiveInHierarchy());
|
||||||
|
}
|
||||||
|
|
||||||
Actor* Script::GetActor() const
|
Actor* Script::GetActor() const
|
||||||
{
|
{
|
||||||
return _parent;
|
return _parent;
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_PROPERTY() void SetEnabled(bool value);
|
API_PROPERTY() void SetEnabled(bool value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets value indicating if script is enabled and active in the scene graph. It must be active as well as all it's parents.
|
||||||
|
/// </summary>
|
||||||
|
API_PROPERTY(Attributes="HideInEditor, NoSerialize") bool IsEnabledInHierarchy() const;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the actor owning that script.
|
/// Gets the actor owning that script.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user