public void Attack(Transform target) { Combative combative = target.GetComponent <Combative>(); if (combative) { Debug.Log(name + " attacked by " + target.name); combative.Attack(_stats); } }
public void Attack(Transform target) { Combative combative = target.GetComponent <Combative>(); if (combative) { Debug.Log(name + " attacked by " + target.name); combative.Attack(_stats); PlayerManager.Instance.UpdateHealthBar(); } }
public override void Interact() { base.Interact(); Combative playerComb = PlayerManager.Instance.Player.GetComponent <Combative>(); GameObject[] minions = PlayerManager.Instance.Minions; foreach (var minion in minions) { Combative minionComb = minion.GetComponent <Combative>(); if (minionComb) { minionComb.Attack(_combative); } } if (playerComb) { playerComb.Attack(_combative); } }