Example #1
0
    public void Attack(Transform target)
    {
        Combative combative = target.GetComponent <Combative>();

        if (combative)
        {
            Debug.Log(name + " attacked by " + target.name);
            combative.Attack(_stats);
        }
    }
Example #2
0
    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();
        }
    }
Example #3
0
    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);
        }
    }