예제 #1
0
 void playerInput()
 {
     //////if (Input.GetKey(KeyCode.S))
     //////{ rotateArm.rotateLeft();
     //////    Debug.Log("l");
     //////}
     //////if (Input.GetKey(KeyCode.W))
     //////{
     //////    rotateArm.rotateRight();
     //////    Debug.Log("r");
     //////}
     if (!Input.GetKey(KeyCode.A) && !Input.GetKey(KeyCode.D) && rotateArm.isEnabled())
     {
         rotateArm.stopRotate();
     }
     if (Input.GetKeyDown(KeyCode.Space))
     {
         swichMoveMent();
     }
     //if (Input.GetKeyDown(KeyCode.W)&&slimeArm.isEnabled())
     //    slimeArm.activate();
     //if (!Input.GetKey(KeyCode.W)&&slimeArm.isEnabled())
     //    slimeArm.deactivate();
     if (Input.GetKey(KeyCode.K) && grapple.isEnabled() && rotateArm.isActivate())
     {
         shootHook();
     }
     if (Input.GetKeyDown(KeyCode.J) && landHit.isEnabled() && rotateArm.isActivate())
     {
         attack();
     }
     if (Input.GetKeyDown(KeyCode.J) && basicMoveMent.isActivate())
     {
         Debug.Log("jp");
         basicMoveMent.Jump();
     }
 }
예제 #2
0
 public void swichMoveMent() //Switch the movement way between rotating arm and walking
 {
     if (rotateArm.isEnabled())
     {
         if (basicMoveMent.isActivate())
         {
             basicMoveMent.deactivate();
             rotateArm.activate();
         }
         else
         {
             basicMoveMent.activate();
             rotateArm.deactivate();
         }
     }
 }