public void Add(INode obj) { if (obj is EnemyNode) { EnemyNode enemyNode = (obj as EnemyNode); enemyNode.targetTriggerComponent.entityInRange += CheckTarget; } else _targetNode = obj as EnemyTargetNode; }
public void Remove(INode obj) { if (obj is EnemyNode) { EnemyNode enemyNode = (obj as EnemyNode); enemyNode.targetTriggerComponent.entityInRange -= CheckTarget; } else _targetNode = null; }
public void Remove(INode obj) { if (obj is EnemyNode) { var enemyNode = obj as EnemyNode; var healthEventsComponent = enemyNode.healthComponent; healthEventsComponent.isDead.subscribers -= StopEnemyOnDeath; } else _targetNode = null; }