Esempio n. 1
0
 void Update()
 {
     MoveCommand(GamePad.GetAxis(GamePad.Axis.LeftStick, TargetPad).x);
     if (GamePad.GetButtonDown(GamePad.Button.B, TargetPad))
     {
         targetCharacter.Bark();
     }
     if (GamePad.GetButtonDown(GamePad.Button.A, TargetPad))
     {
         targetCharacter.Jump();
     }
     if (!interactSwitch && GamePad.GetAxis(GamePad.Axis.LeftStick, TargetPad).y > 0.7f)
     {
         interactSwitch = true;
         targetCharacter.Interact();
     }
     if (!downfloorSwitch && GamePad.GetAxis(GamePad.Axis.LeftStick, TargetPad).y < -0.7f)
     {
         downfloorSwitch = true;
         targetCharacter.DownFloor();
     }
     if (interactSwitch && GamePad.GetAxis(GamePad.Axis.LeftStick, TargetPad).y <= 0.7f)
     {
         interactSwitch = false;
     }
     if (downfloorSwitch && GamePad.GetAxis(GamePad.Axis.LeftStick, TargetPad).y >= -0.7f)
     {
         downfloorSwitch = false;
     }
     // showIntense.text = "Pad" + padNumber + ": " + GamePad.GetAxis(GamePad.Axis.LeftStick, TargetPad).y;
 }
Esempio n. 2
0
 void Update()
 {
     MoveCommand(Input.GetAxis(horControl));
     if (Input.GetButtonDown(barkControl))
     {
         targetCharacter.Bark();
     }
     if (Input.GetButtonDown(jumpControl))
     {
         targetCharacter.Jump();
     }
     if (!interactSwitch && Input.GetAxis(vertControl) > 0.7f)
     {
         interactSwitch = true;
         targetCharacter.Interact();
     }
     if (!downfloorSwitch && Input.GetAxis(vertControl) < -0.7f)
     {
         downfloorSwitch = true;
         targetCharacter.DownFloor();
     }
     if (interactSwitch && Input.GetAxis(vertControl) <= 0.7f)
     {
         interactSwitch = false;
     }
     if (downfloorSwitch && Input.GetAxis(vertControl) >= -0.7f)
     {
         downfloorSwitch = false;
     }
 }