/// <summary> /// Called by the input manager, this method turns controls visible or not depending on what's been chosen /// </summary> /// <param name="state">If set to <c>true</c> state.</param> /// <param name="movementControl">Movement control.</param> public virtual void SetMobileControlsActive(bool state, InputManager.MovementControls movementControl = InputManager.MovementControls.Joystick) { Initialization(); if (Joystick != null) { Joystick.gameObject.SetActive(state); if (state && movementControl == InputManager.MovementControls.Joystick) { Joystick.alpha = _initialJoystickAlpha; } else { Joystick.alpha = 0; Joystick.gameObject.SetActive(false); } } if (Arrows != null) { Arrows.gameObject.SetActive(state); if (state && movementControl == InputManager.MovementControls.Arrows) { Arrows.alpha = _initialJoystickAlpha; } else { Arrows.alpha = 0; Arrows.gameObject.SetActive(false); } } if (Buttons != null) { Buttons.gameObject.SetActive(state); if (state) { Buttons.alpha = _initialButtonsAlpha; } else { Buttons.alpha = 0; Buttons.gameObject.SetActive(false); } } }
public static void Trigger(bool status, InputManager.MovementControls movementControl) { e.Status = status; e.MovementControl = movementControl; MMEventManager.TriggerEvent(e); }
/// <summary> /// Initializes a new instance of the <see cref="MoreMountains.MMInterface.MMFadeOutEvent"/> struct. /// </summary> /// <param name="duration">Duration.</param> public ControlsModeEvent(bool status, InputManager.MovementControls movementControl) { Status = status; MovementControl = movementControl; }