void UpdateLoopingMode() { //This is the gamepad control and looping mode is initialized by pressing down the left thumbstick //You can easily leave looping mode with the gamepad by letting go of the thumbstick for a split second //thats why we are only initiating looping mode here, instead of toggling it for keyboard and mouse input if (Input.GetButton("LoopingMode") == true) { ShipMovement.InitiateLoopingMode(); } //The way the mouse input is constructed, the ship will continue to turn in the same direction it did before //even if you don't move the mouse. This means it's not easy to just return the mouse into a zero position to //leave looping mode. So we give the player the option to toggle it on and off by repeatedly pressing the looping button if (Input.GetButtonDown("LoopingModeKeyboard")) { if (ShipMovement.IsInLoopingMode == true) { m_MousePosition = Vector2.zero; } ShipMovement.ToggleLoopingMode(); } }