コード例 #1
0
ファイル: BallManager.cs プロジェクト: imengyu/Ballance2
        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");
        }
コード例 #2
0
        private void InitModDebug()
        {
            UIManager    = (UIManager)GameManager.GetManager(UIManager.TAG);
            DebugManager = (IDebugManager)GameManager.GetManager("DebugManager");
            DebugManager.RegisterCommand("loadmod", OnCommandLoadMod, 1, "[packagePath:string] [initialize:true/false] 加载模组 [模组完整路径] [是否立即初始化]");
            DebugManager.RegisterCommand("unloadmod", OnCommandUnLoadMod, 1, "[packageUid:int]  加载模组 [模组UID]");
            DebugManager.RegisterCommand("initmod", OnCommandInitializeMod, 1, "[packageUid:int]  初始化模组 [模组UID]");
            DebugManager.RegisterCommand("modasset", OnCommandShowModAssets, 1, "[packageUid:int]  显示模组包内所有资源 [模组UID]");
            DebugManager.RegisterCommand("mods", OnCommandShowAllMod, 0, "显示所有模组");
            DebugManager.AddCustomDebugToolItem("模组管理器", new GameHandler(TAG, OnDebugToolItemClick));

            settings    = GameSettingsManager.GetSettings("core");
            hideCoreMod = settings.GetBool("modmgr.hideCoreMod", true);

            InitModManagementWindow();
        }
コード例 #3
0
ファイル: GameInit.cs プロジェクト: imengyu/Ballance2
        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");
        }
コード例 #4
0
ファイル: SoundManager.cs プロジェクト: imengyu/Ballance2
        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);
        }