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(); }
// Start is called before the first frame update void Start() { joyStick = FindObjectOfType <JoyStickController>(); player = FindObjectOfType <PlayerController>().gameObject; playerCont = player.GetComponent <PlayerController>(); rb = GetComponent <Rigidbody2D>(); }
static public JoyStickController getInstance() { if (_instance == null) { _instance = new JoyStickController(); } return(_instance); }
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(); } }
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(); }
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>(); } }
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> (); }
private void Start() { _controller = JoyStickController.Instance; }