Beispiel #1
0
        private void InitSettings()
        {
            GameSettings = GameSettingsManager.GetSettings("core");
#if UNITY_EDITOR
            debug = true;
#else
            debug = GameSettings.GetBool("debug");
#endif
            GameSettings.RegisterSettingsUpdateCallback("control", new GameHandler(TAG, OnControlSettingsChanged));
            GameSettings.RequireSettingsLoad("control");
        }
Beispiel #2
0
        private void InitVideoSettings()
        {
            //屏幕大小事件
            GameManager.GameMediator.RegisterGlobalEvent(GameEventNames.EVENT_SCREEN_SIZE_CHANGED);

            resolutions = Screen.resolutions;

            for (int i = 0; i < resolutions.Length; i++)
            {
                if (resolutions[i].width == Screen.width && resolutions[i].height == Screen.height)
                {
                    defaultResolution = i;
                    break;
                }
            }

            //设置更新事件
            GameSettings = GameSettingsManager.GetSettings("core");
            GameSettings.RegisterSettingsUpdateCallback("video", new GameHandler(TAG, OnVideoSettingsUpdated));
            GameSettings.RequireSettingsLoad("video");
        }
Beispiel #3
0
        public override bool InitManager()
        {
            audioSourcePrefab = GameManager.FindStaticPrefabs("AudioSource");
            fastPlayVoices    = new Dictionary <string, AudioSource>();

            InitGameAudioMixer();

            GameManager.GameMediator.RegisterEventHandler(
                GameEventNames.EVENT_BASE_INIT_FINISHED, TAG, (e, p) =>
            {
                GameLogger.Log(TAG, GameEventNames.EVENT_BASE_INIT_FINISHED);
                ModManager = (ModManager)GameManager.GetManager(ModManager.TAG);
                return(false);
            }
                );

            //设置更新事件
            GameSettings = GameSettingsManager.GetSettings("core");
            GameSettings.RegisterSettingsUpdateCallback("voice", new GameHandler(TAG, OnVoiceSettingsUpdated));
            GameSettings.RequireSettingsLoad("voice");
            return(true);
        }