Exemplo n.º 1
0
 /// <summary>
 /// Turns mobile controls on or off depending on what's been defined in the inspector, and what target device we're on
 /// </summary>
 public virtual void ControlsModeDetection()
 {
     ControlsModeEvent.Trigger(false, MovementControls.Joystick);
     IsMobile = false;
     if (AutoMobileDetection)
     {
         #if UNITY_ANDROID || UNITY_IPHONE
         ControlsModeEvent.Trigger(true, MovementControl);
         IsMobile = true;
         #endif
     }
     if (ForcedMode == InputForcedMode.Mobile)
     {
         ControlsModeEvent.Trigger(true, MovementControl);
         IsMobile = true;
     }
     if (ForcedMode == InputForcedMode.Desktop)
     {
         ControlsModeEvent.Trigger(false, MovementControls.Joystick);
         IsMobile = false;
     }
     if (HideMobileControlsInEditor)
     {
         #if UNITY_EDITOR
         ControlsModeEvent.Trigger(false, MovementControls.Joystick);
         IsMobile = false;
         #endif
     }
 }
Exemplo n.º 2
0
 public virtual void OnMMEvent(ControlsModeEvent controlsModeEvent)
 {
     SetMobileControlsActive(controlsModeEvent.Status, controlsModeEvent.MovementControl);
 }