fix: StateEnableMonoBehaviour Not Getting Back Enabled When The GameObject Is Disabled In Hierarchy Fixed
This commit is contained in:
@@ -25,6 +25,12 @@ namespace Syntriax.Modules.State
|
||||
=> OnEnabledChanged += (state) => enabled = state;
|
||||
|
||||
protected void OnEnable() => IsEnabled = true;
|
||||
protected void OnDisable() => IsEnabled = false;
|
||||
protected void OnDisable()
|
||||
{
|
||||
IsEnabled = false;
|
||||
|
||||
if (!gameObject.activeInHierarchy) // Just so we can get OnEnable called when the object is back active again in the hierarchy
|
||||
this.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user