feat: Register and unregister BatchLOSSystem in EnemyBase lifecycle methods
This commit is contained in:
@@ -644,10 +644,12 @@ namespace BaseGames.Enemies
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
_onPlayerSpawned?.Subscribe(SetPlayerTransform).AddTo(_subs);
|
||||
Core.ServiceLocator.GetOrDefault<AI.BatchLOSSystem>()?.Register(this);
|
||||
}
|
||||
|
||||
protected virtual void OnDisable()
|
||||
{
|
||||
Core.ServiceLocator.GetOrDefault<AI.BatchLOSSystem>()?.Unregister(this);
|
||||
_subs.Clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user