Ejemplo n.º 1
0
 /// <summary>
 /// Toggles movement, returns true/false if enabled/disabled
 /// </summary>
 /// <returns></returns>
 public static bool ToggleMovement()
 {
     Disable(isDisabled);
     CamMouseLook.SetRotation(isDisabled);
     if (!isDisabled)
     {
         Cursor.lockState = CursorLockMode.Locked;
     }
     else
     {
         Cursor.lockState = CursorLockMode.None;
     }
     return(isDisabled);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Enabled = true, disabled = false
 /// </summary>
 /// <param name="movement">Set movement enabled</param>
 /// <param name="rotation">Set rotation enabled</param>
 /// <returns></returns>
 public static bool SetMovement(bool movement, bool rotation)
 {
     if (isDisabled != movement)
     {
         Disable(!movement);
     }
     if (CamMouseLook.GetEnabled != rotation)
     {
         CamMouseLook.SetRotation(!rotation);
     }
     // If it worked, return true
     if (isDisabled == !movement && CamMouseLook.GetEnabled == rotation)
     {
         return(true);
     }
     return(false);
 }