public void OnMouseModeChanged(InputEnabled mode) { bool showTarget = eventsManager.mouseMode == InputEnabled.Disabled && eventsManager.diggingMode == DiggingMode.NotDigging; target.gameObject.SetActive(showTarget); }
/// <summary> /// Pop disabled input state. When the last disabled state is /// popped off the stack input will be re-enabled. /// </summary> public void PopInputDisable() { --disabledRefCount; Debug.Assert(disabledRefCount >= 0, "Tried to pop more input disable than the amount pushed."); if (disabledRefCount == 0) { InputEnabled.RaiseEvent(); } }
/// <summary> /// Clear the input disable stack, which will immediately re-enable input. /// </summary> public void ClearInputDisableStack() { bool wasInputDisabled = disabledRefCount > 0; disabledRefCount = 0; if (wasInputDisabled) { InputEnabled.RaiseEvent(); } }
public InputEnabled InvertMouseMode(InputEnabled mouseMode) { switch (mouseMode) { case InputEnabled.Disabled: return(InputEnabled.Enabled); case InputEnabled.Enabled: return(InputEnabled.Disabled); } return(InputEnabled.Enabled); }
public void Start() { diggingMode = DiggingMode.NotDigging; mouseMode = InputEnabled.Disabled; computerInputMode = InputEnabled.Disabled; computerInput = FindObjectOfType <ComputerInput>(); computerInput.gameObject.SetActive(false); deviceInputMode = InputEnabled.Disabled; deviceInput = FindObjectOfType <DeviceInput>(); deviceInput.gameObject.SetActive(false); }
public void SetMouseMode(InputEnabled mouseMode) { switch (mouseMode) { case InputEnabled.Disabled: Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; break; case InputEnabled.Enabled: Cursor.lockState = CursorLockMode.None; Cursor.visible = true; break; } MouseModeChanged(mouseMode); }
public void MouseModeChanged(InputEnabled mouseMode) { this.mouseMode = mouseMode; OnMouseModeChanged?.Invoke(mouseMode); }
internal void StopEditingDevice() { deviceInput.SetDevice(null); deviceInput.gameObject.SetActive(false); deviceInputMode = InputEnabled.Disabled; }
public void StartEditingDevice(Device device) { deviceInput.SetDevice(device); deviceInput.gameObject.SetActive(true); deviceInputMode = InputEnabled.Enabled; }
public void StopEditingComputer() { computerInput.SetComputer(null); computerInput.gameObject.SetActive(false); computerInputMode = InputEnabled.Disabled; }
public void StartEditingComputer(Computer computer) { computerInput.SetComputer(computer); computerInput.gameObject.SetActive(true); computerInputMode = InputEnabled.Enabled; }
public void DisableInputs() { inputEnabled = new InputEnabled(false, false, false, false, false, false, this); }
public void EnableInputs() { inputEnabled = new InputEnabled(true, true, true, true, true, true, this); }