Exemplo n.º 1
0
    void Start()
    {
        character       = GetComponent <Character>();
        characterAsMove = GetComponent <Character>() as IMove;
        if (characterAsMove == null)
        {
            Debug.LogWarning("Chase State set on an object (" + name + ") that does not have a Character component that implements IMove.");
        }
        characterAsAI = GetComponent <Character>() as IHaveAI;
        if (characterAsAI == null)
        {
            Debug.LogWarning("Chase State set on an object (" + name + ") that does not have a Character component that implements IHaveAI.");
        }
        target = characterAsAI.Target.gameObject.GetComponent <Character>() as IHaveStats;
        if (target == null)
        {
            Debug.LogWarning("Target set on an object (" + name + ") that does not have a Character component that implements IHaveStats.");
        }

        SetMaterial();
    }
Exemplo n.º 2
0
 public void ProcessAttack(IHaveStats target, int amount)
 {
     target.ModifyHealth(amount);
 }