Exemplo n.º 1
0
        public static EventfulUnityInputDevice GetDevice()
        {
            if (_device != null)
            {
                return(_device);
            }

            if (_inputManager == null)
            {
                _inputManager = Services.Get <IGameInputManager>();
                if (_inputManager != null)
                {
                    _inputManager.ServiceUnregistered += (s, e) =>
                    {
                        _inputManager = null;
                        _device       = null;
                    };
                }
                else
                {
                    return(null);
                }
            }

            _device = new EventfulUnityInputDevice();
            _inputManager.Add(INPUT_ID, _device);
            return(_device);
        }
        public static EventfulUnityInputDevice GetDevice()
        {
            if (_device != null)
            {
                return(_device);
            }

            _device = new EventfulUnityInputDevice();
            GameLoopEntry.UpdatePump.Add(_device);
            return(_device);
        }
Exemplo n.º 3
0
 public static EventfulUnityInputDevice GetDevice()
 {
     if (_device == null)
     {
         _device = new EventfulUnityInputDevice();
     }
     if (_inputManager == null)
     {
         _inputManager = Singleton.GetInstance <GameInputManager>();
         _inputManager.Add(INPUT_ID, _device);
     }
     return(_device);
 }