Esempio n. 1
0
 void CheckToPush()
 {
     //Para empujar el cofre debe de estar vacío y el player debe de estar andando hacia el cofre
     if (playerController.isWalking)
     {
         if (!Game.chestEmpty)
         {
             //Hay que vaciar el cofre primero
             playerController.StopPlayerMove();
             chest.buttonsDisabled = true;
             sequencer.StartCoroutine("StartSequence", sequenceName);
         }
         else if (!playerController.isJumping && !playerController.isOnChest)
         {
             rabbitCollider.enabled = true;
             joint.enabled          = true;
             rigidBody.bodyType     = RigidbodyType2D.Dynamic;
             submitButtonImage.SetActive(false);
             cancelButtonImage.SetActive(true);
             playerController.isPushing = true;
             animator.SetBool("isPushing", true);
         }
     }
     else
     if (!playerController.isOnChest && !playerController.isPushing && !chest.isAtBottom)
     {
         playerController.StartCoroutine(playerController.Jump(jumpPosition.position, true));
         CheckForUpdateOffset(onUpPosition);
     }
 }