Beispiel #1
0
    public virtual void OnDeath(int pDamage = 0, BaseActor pKiller = null)
    {
        whoHit.Clear();

        isAlive = false;

        if(onDeathCallback != null)
            onDeathCallback(this);

        onDeathCallback = null;
    }
Beispiel #2
0
    // Metodo para recebicao de Dano
    public virtual void ReceiveDamage(int pDamage, BaseActor pBully)
    {
        if(!whoHit.Contains(pBully)){
            onDeathCallback += pBully.OnMurder;
            whoHit.Add(pBully);
        }

        currentLife -= pDamage;

        if(currentLife <= 0)
            OnDeath();
    }
 void Awake()
 {
     _controller      = GetComponent <PlayerController>();
     onDeathDelegate += OnDeath;
 }