public override void HandleNewOrExistingTouch(Touch t) { if (Player != null) { Player.Action(); } }
private void FixedUpdate() { horizontal = Input.GetAxis("Horizontal"); vertical = Input.GetAxis("Vertical"); player.Move(horizontal, vertical); if (action) { player.Action(); action = false; } }
private void ProcessInput() { // Button down press if (Input.GetButtonDown("Action")) { pc.Action(); } if (Input.GetButtonDown("AltAction")) { pc.AltAction(); } if (Input.GetButtonDown("Cancel")) { pc.Cancel(); } if (Input.GetButtonDown("Start")) { pc.Start(); } // Button up if (Input.GetButtonUp("Action")) { pc.ActionRelease(); } if (Input.GetButtonUp("AltAction")) { pc.AltActionRelease(); } if (Input.GetButtonUp("Cancel")) { pc.CancelRelease(); } if (Input.GetButtonUp("Start")) { pc.StartRelease(); } // Axes float hAxis = Input.GetAxisRaw("Horizontal"); float vAxis = Input.GetAxisRaw("Vertical"); pc.Horizontal(hAxis); pc.Vertical(vAxis); if (hAxis == 0 && vAxis == 0) { pc.Idle(); } }