Пример #1
0
        public void OnInitModule(IUnityAssetManager assetManager)
        {
            var cmdGenerator = _contexts.session.clientSessionObjects.UserCmdGenerator as UnityUserCmdGenerator;

            if (null != cmdGenerator)
            {
                var mode = _contexts.session.commonSession.RoomInfo.ModeId;
#if UNITY_EDITOR
                if (mode == 0)
                {
                    mode = SharedConfig.ModeId;
                }
#endif
                var bagType = SingletonManager.Get <GameModeConfigManager>().GetBagTypeById(mode);
                IGlobalKeyInputMapper inputMapper = null;
                switch (bagType)
                {
                case XmlConfig.EBagType.Group:
                    inputMapper = new GroupModeInputMapper(_contexts);
                    break;

                default:
                    inputMapper = new DefaultModeInputMapper();
                    break;
                }
                cmdGenerator.RegisterGlobalKeyhandler(inputMapper);
                cmdGenerator.BeginReceiveUserInput(_contexts.userInput.userInputManager.Instance);
            }
        }
Пример #2
0
 public void RegisterGlobalKeyReceiver(IGlobalKeyInputMapper inputMapper)
 {
     _inputMapperList.Add(inputMapper);
 }
 public void RegisterGlobalKeyhandler(IGlobalKeyInputMapper inputMapper)
 {
     inputMapperList.Add(inputMapper);
 }