Esempio n. 1
0
 private void Attacking()
 {
     if (warriorController.MaintainingGround() && warriorController.canAction)
     {
         if (GUI.Button(new Rect(25, 85, 100, 30), "Attack1"))
         {
             warriorController.Attack1();
         }
     }
 }
Esempio n. 2
0
 // Run every frame we are in the idle state.
 private void Idle_SuperUpdate()
 {
     // If Jump.
     if (warriorController.canJump && warriorController.inputJump)
     {
         currentState = WarriorState.Jump;
         return;
     }
     // In air.
     if (!warriorController.MaintainingGround())
     {
         currentState = WarriorState.Fall;
         return;
     }
     if (warriorController.HasMoveInput() && warriorController.canMove)
     {
         currentState = WarriorState.Move;
         return;
     }
     // Apply friction to slow to a halt.
     currentVelocity = Vector3.MoveTowards(currentVelocity, Vector3.zero, groundFriction
                                           * warriorController.superCharacterController.deltaTime);
 }