示例#1
0
 public PauseState(MarioGame game)
 {
     this.game      = game;
     graphicsDevice = game.GraphicsDevice;
     if (game.IskeyboardController)
     {
         game.Controller = new KeyboardController((Keys.O, new PauseCommand(game), new EmptyCommand(), false));
     }
     else
     {
         game.Controller = new JoyStickController(game.Player, (Microsoft.Xna.Framework.Input.Buttons.LeftShoulder, new PauseCommand(game), new EmptyCommand(), false));
     }
     MediaPlayer.Pause();
     AudioFactory.Instance.CreateSound(StringConsts.Pause).Play();
 }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     joyStick   = FindObjectOfType <JoyStickController>();
     player     = FindObjectOfType <PlayerController>().gameObject;
     playerCont = player.GetComponent <PlayerController>();
     rb         = GetComponent <Rigidbody2D>();
 }
示例#3
0
 static public JoyStickController getInstance()
 {
     if (_instance == null)
     {
         _instance = new JoyStickController();
     }
     return(_instance);
 }
示例#4
0
        public void openJoyStick()
        {
            if (!_joyStickIsOpen)
            {
                this._joyStick = JoyStickController.Instance;//new JoyStickController(this, this._usb.GetControlRefYaw);

                this._joyStick.setUp(this, this._usb.GetControlRefYaw);
                this._joyStick.Closing += new CancelEventHandler(closeJoyStick);
                this._joyStickIsOpen    = true;
                this._joyStick.Show();


                //this.requestPidOnOffStatus();
                //this.requestPidConst();
            }
        }
示例#5
0
        void FixedUpdate()
        {
            // Store the input axes.
            //float h = CrossPlatformInputManager.GetAxisRaw("Horizontal");
            //float v = CrossPlatformInputManager.GetAxisRaw("Vertical");

            //Move (h, v);
            //Turning ();
            //Animating (h, v);
            JoyStickController joy = GameObject.Find("BtnStick").GetComponent <JoyStickController>();
            int     state;
            Vector2 vec = joy.NormFormatHVJoy(out state);

            Move(vec.x, vec.y);
            Vector3 vec3 = new Vector3(vec.x, 0, vec.y);

            Animating(vec.x, vec.y);

            joy.CheckShow();
        }
示例#6
0
 private void Awake()
 {
     _instance = this;
     if (player == null)
     {
         player = FindObjectOfType <Player>();
     }
     if (joyStick == null)
     {
         joyStick = FindObjectOfType <JoyStickController>();
     }
     if (laserManager == null)
     {
         laserManager = GetComponent <LaserManager>();
     }
     if (uiManager == null)
     {
         uiManager = GetComponent <UiManager>();
     }
 }
示例#7
0
 void Start()
 {
     this.muzzle = this.transform.Find ("Armature/Bone/hip_0/chest_0/arm_R_0/forearm_R/muzzle").gameObject;
     this.state = PlayerState.Normal;
     this.controller = this.GetComponent<JoyStickController> ();
     this.controller.cameraControl.cameraTransform = Camera.main.transform;
     this.controller.cameraControl.cameraTransform.position = this.transform.position;
     this.head = this.transform.Find ("Armature/Bone/hip_0/chest_0/head").gameObject;
     this.renderer = this.GetComponent<LineRenderer> ();
 }
示例#8
0
 private void Start()
 {
     _controller = JoyStickController.Instance;
 }