예제 #1
0
 private void OnTriggerStay2D(Collider2D collision)
 {
     if (collision.tag == "Escalera")
     {
         inLadder = true;
     }
     if (collision.tag == "Item")
     {
         currentItem = collision.GetComponent <Item>();
     }
     if (collision.gameObject.tag == "Basurero")
     {
         if (Input.GetKeyDown(keyAccion) && statePlayer != StatePlayer.Stunt)
         {
             enableMovement   = false;
             statePlayer      = StatePlayer.InHealling;
             delayHealling    = auxDelayHealling;
             gameObject.layer = 9;
             Basurero basurero = collision.gameObject.GetComponent <Basurero>();
             if (life < maxLife)
             {
                 life = life + basurero.countLifeRecover;
                 if (life > maxLife)
                 {
                     life = maxLife;
                 }
                 //Debug.Log("ENTRE");
                 animator.SetTrigger("EntrarAlTacho");
             }
         }
     }
 }
예제 #2
0
 private void Awake()
 {
     basurero = this;
 }