Esempio n. 1
0
 public void Kill(GameWorld.LevelOverReason reason)
 {
     Interrupted();
     GameWorld.levelOverReason = reason;
     if (reason == GameWorld.LevelOverReason.PatientInfected)
     {
         animator.SetTrigger("Kill");
         Execute(Trigger.ActionType.Destroy);
     }
     else
     {
         _ashController.Trigger(entity.position);
         Destroy(this.gameObject);
         //Entity.Replace(this.gameObject, ashes);
     }
     //animator.SetTrigger(reason == GameWorld.LevelOverReason.PatientInfected ? "Kill" : "Die");
     GetComponent <Collider2D>().enabled = false;
     treated = true;
 }
Esempio n. 2
0
    public void Die(GameWorld.LevelOverReason reason = GameWorld.LevelOverReason.LaserKilledPlayer)
    {
        IsAlive = false;
        this.GetComponent <Collider2D>().enabled = false;

        if (reason == GameWorld.LevelOverReason.Squashed)
        {
            GetComponent <Renderer>().enabled = false;
            animator.enabled     = false;
            transform.localScale = new Vector3(
                transform.localScale.x * 0.1f,
                transform.localScale.y,
                transform.localScale.z);
        }
        else
        {
            animator.SetTrigger("Die");
            //ashes.SetActive(true);
            _ashController.Trigger(transform.position);
            Destroy(this.gameObject);
            //Entity.Replace(this.gameObject, ashes);
        }
        GameWorld.levelOverReason = reason;
    }