Exemplo n.º 1
0
        private void Init()
        {
            config = GameBootConfig.LoadConfig();
            if (config == null)
            {
                config = new GameBootConfig();
            }

            allModules.Clear();
            Type[] types = ReflectionUtils.GetChildTypes(typeof(AppModuleBase));
            foreach (var type in types)
            {
                if (type.IsAbstract)
                {
                    continue;
                }

                AppModuleBase appModule = null;

                if (config.allAppModuleSetting.ContainsKey(type.Name))
                {
                    appModule = (AppModuleBase)ReflectionUtils.CreateDefultInstance(type);
                    appModule = (AppModuleBase)config.allAppModuleSetting[type.Name].GetValue(appModule);
                }
                else
                {
                    appModule = (AppModuleBase)ReflectionUtils.CreateDefultInstance(type);
                }
                allModules.Add(type, appModule);
            }
        }
    void IPreprocessBuildWithReport.OnPreprocessBuild(BuildReport report)
    {
        Debug.Log("OnPreprocessBuild");

        GameBootConfig config = GameBootConfig.LoadConfig();

        if (config != null)
        {
            config.buildTime = DateTime.Now.Ticks;
            GameBootConfig.Save(config);
            AssetDatabase.Refresh();
            Debug.Log("OnPreprocessBuild GameBootConfig:" + config.buildTime);
        }
    }