public void SwitchInputContext(EInputContextType contextType) { if (contextType != currentInputContextType) { RemoveInputContext(currentInputContextType); currentInputContextType = contextType; AddInputContext(contextType); } }
private void Start() { _inputMapper = new InputMapper(); _inputConfig = Resources.Load <InputConfig>("InputConfig"); _inputContextDic.Add(_inputConfig.normalHumanContext.inputContextType, new InputContext(_inputConfig.normalHumanContext)); _inputContextDic.Add(_inputConfig.priorityConfig.inputContextType, new InputContext(_inputConfig.priorityConfig)); currentInputContextType = EInputContextType.NormalHumanPlayer; AddInputContext(currentInputContextType); InitVirtualKeyAccessableDic(); }
private void RemoveInputContext(EInputContextType contextType) { _inputMapper.RemoveInputContext(_inputContextDic[contextType]); }
private void AddInputContext(EInputContextType contextType) { _inputMapper.AddInputContext(_inputContextDic[contextType]); }