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); }
private void Start() { if (_manager == null) { _manager = ServiceLocator.Instance.GetService <IGameInputManager>(); } }
public void Init(IGameInputManager editorInputManager, EntityParent theOwner) { if (RuntimePlatform.WindowsEditor == Application.platform) { this.m_inputManager = editorInputManager; } if (this.m_inputManager != null) { this.m_inputManager.Init(theOwner); } }
void Inject( ITilemapView tilemapView, ICameraView cameraView, IGameInputManager inputManager, IPlaceTileUseCase mapPlaceUseCase, ITileSelectView tileSelectView) { _tilemapView = tilemapView; _cameraView = cameraView; _inputManager = inputManager; _tileSelectView = tileSelectView; _mapPlaceUseCase = mapPlaceUseCase; _model = new GameInputModel(); }
protected override void Init() { _map = _locator.GetService <IHexMap>(); _im = _locator.GetService <IGameInputManager>(); _gem = _locator.GetService <IEntityManager>(); _config = JsonConvert.DeserializeObject <GameConfiguration>(configFile.text); _seed = 0; _input = new InputStateMachine(); _input.SetState(new SpectateInputState(_input)); _im.RegisterProcessor(_input); //ChanceTest(); Generate(); }