chore: cleanup

This commit is contained in:
2025-04-01 13:29:56 +03:00
parent 417ddca972
commit c71bf71fb3
2 changed files with 8 additions and 9 deletions

View File

@@ -11,7 +11,6 @@ public abstract class BehaviourBase : BaseEntity, IBehaviour
public event IActive.ActiveChangedEventHandler? OnActiveChanged = null;
private IBehaviourController _behaviourController = null!;
public IBehaviourController BehaviourController => _behaviourController;
private int _priority = 0;
@@ -29,7 +28,8 @@ public abstract class BehaviourBase : BaseEntity, IBehaviour
}
}
public bool IsActive { get; private set; } = false;
private bool _isActive = false;
public bool IsActive => _isActive;
protected virtual void OnAssign(IBehaviourController behaviourController) { }
public bool Assign(IBehaviourController behaviourController)
@@ -80,7 +80,7 @@ public abstract class BehaviourBase : BaseEntity, IBehaviour
private void UpdateActive()
{
bool previousActive = IsActive;
IsActive = StateEnable.Enabled && _behaviourController.HierarchyObject.IsActive;
_isActive = StateEnable.Enabled && _behaviourController.HierarchyObject.IsActive;
if (previousActive != IsActive)
OnActiveChanged?.Invoke(this, previousActive);