private void Init() { targetable = GetComponent <Targetable>(); targetable.RegisterOnTargetDestroyed(OnTargetDestroyed); targetable.RegisterOnHealthChanged(OnHealthChanged); foreach (var node in batteriesNodes) { node.gameObject.SetActive(false); } RegisterBattery(); OnHealthChanged(0); }
public EnemyAttackState(Targetable targetable) { target = targetable; target.RegisterOnTargetDestroyed(OnTargetDestroyed); target.BecameInvulnerable += OnTargetInvulnerable; }