protected void Kill(ActorDiedEventArgs args)
    {
        Alive = false;

        if (args.Killer != null)
        {
            ActorGainedExperienceEventArgs tempArgs = new ActorGainedExperienceEventArgs(args.Killer, this.ExpReward);
            args.Killer.GainExperience(tempArgs);
        }
    }
    protected IEnumerator WatchForDeath()
    {
        while (Mechanics == null ||
               Mechanics.Health == null ||
               Mechanics.Health.IsAlive)
        {
            yield return(null);
        }

        ActorDiedEventArgs arg = new ActorDiedEventArgs(ExpReward, LastAttacker, this);

        OnActorDied(arg);
    }
Example #3
0
 private void PlayerDeath(ActorDiedEventArgs args)
 {
     //Debug.Log ("YOU DIED");
     StopCoroutine("CheckExperience");
 }
Example #4
0
 private void EnemyDeath(ActorDiedEventArgs args)
 {
     StopCoroutine("WatchForDeath");
     Destroy(gameObject);
 }