Esempio n. 1
0
 private void Blocking()
 {
     if (rpgCharacterController.weapon != Weapon.RELAX)
     {
         blockGui = GUI.Toggle(new Rect(25, 215, 100, 30), blockGui, "Block");
         //Blocking.
         if (blockGui)
         {
             if (!blockToggle)
             {
                 blockToggle = true;
                 rpgCharacterController.canBlock   = false;
                 rpgCharacterController.isBlocking = true;
                 rpgCharacterController.animator.SetBool("Blocking", true);
                 rpgCharacterMovementController.canMove = false;
                 rpgCharacterController.animator.SetTrigger("BlockTrigger");
             }
             if (GUI.Button(new Rect(30, 240, 100, 30), "Get Hit"))
             {
                 rpgCharacterController.GetHit();
             }
             if (GUI.Button(new Rect(30, 270, 100, 30), "Block Break"))
             {
                 rpgCharacterController.BlockBreak();
             }
         }
         //Not Blocking.
         else
         {
             if (blockToggle)
             {
                 rpgCharacterController.isBlocking = false;
                 rpgCharacterController.animator.SetBool("Blocking", false);
                 rpgCharacterMovementController.canMove = true;
                 blockToggle = false;
                 rpgCharacterController.canBlock = true;
             }
         }
     }
 }