コード例 #1
0
        private InputController()
        {
            _controls     = new InputAsset();
            _inputContext = EInputContext.InGame;

            GameInputContext = new InGameInputContext(_controls.Game);
            UIInputContext   = new UIInputContext(_controls.UI);

            EnablePlayerInput();
        }
コード例 #2
0
        public InputController()
        {
            if (_instance != null)
            {
                return;
            }

            _controls     = new InputAsset();
            _instance     = this;
            _inputContext = EInputContext.InGame;

            GameInputContext = new InGameInputContext(_controls.Game);
            UIInputContext   = new UIInputContext(_controls.UI);

            EnablePlayerInput();
        }
コード例 #3
0
        public void SetInputContext(EInputContext context)
        {
            _inputContext = context;

            switch (_inputContext)
            {
            case EInputContext.InGame:
                _controls.Game.Enable();
                _controls.UI.Disable();
                break;

            case EInputContext.UI:
                _controls.UI.Enable();
                _controls.Game.Disable();
                break;

            default:
                _controls.Game.Enable();
                _controls.UI.Disable();
                break;
            }
        }