Пример #1
0
        private void LoadHealthConfig()
        {
            string configName = HealthConfigPopup.s_healthConfigs[HealthConfigPopup.s_currentMode];

            HealthConfig.ConfigJson configJson = HealthConfig.Instance().GetConfig(configName);

            // ------------------------------------------------Texture------------------------------------------------
            ViewerConst.GetSingletonInstance <TextureHealthInfoManager>().Clear();
            foreach (string mode in ViewerConst.GetSingletonInstance <TextureViewerModeManager>().GetMode())
            {
                HealthConfig.ModeConfig modeConfig = configJson.GetModeConfig("Texture", mode);
                if (modeConfig != null)
                {
                    ViewerConst.GetSingletonInstance <TextureHealthInfoManager>().AddHealthInfo(mode, modeConfig.Enable, modeConfig.Tip, modeConfig.ConfigValue, modeConfig.Condition);
                }
            }

            // ------------------------------------------------Model------------------------------------------------
            ViewerConst.GetSingletonInstance <ModelHealthInfoManager>().Clear();
            foreach (string mode in ViewerConst.GetSingletonInstance <ModelViewerModeManager>().GetMode())
            {
                HealthConfig.ModeConfig modeConfig = configJson.GetModeConfig("Model", mode);
                if (modeConfig != null)
                {
                    ViewerConst.GetSingletonInstance <ModelHealthInfoManager>().AddHealthInfo(mode, modeConfig.Enable, modeConfig.Tip, modeConfig.ConfigValue, modeConfig.Condition);
                }
            }

            // ------------------------------------------------Particle------------------------------------------------
            ViewerConst.GetSingletonInstance <ParticleHealthInfoManager>().Clear();
            foreach (string mode in ViewerConst.GetSingletonInstance <ParticleViewerModeManager>().GetMode())
            {
                HealthConfig.ModeConfig modeConfig = configJson.GetModeConfig("Particle", mode);
                if (modeConfig != null)
                {
                    ViewerConst.GetSingletonInstance <ParticleHealthInfoManager>().AddHealthInfo(mode, modeConfig.Enable, modeConfig.Tip, modeConfig.ConfigValue, modeConfig.Condition);
                }
            }

            // ------------------------------------------------Shader------------------------------------------------
            ViewerConst.GetSingletonInstance <ShaderHealthInfoManager>().Clear();
            foreach (string mode in ViewerConst.GetSingletonInstance <ShaderViewerModeManager>().GetMode())
            {
                HealthConfig.ModeConfig modeConfig = configJson.GetModeConfig("Shader", mode);
                if (modeConfig != null)
                {
                    ViewerConst.GetSingletonInstance <ShaderHealthInfoManager>().AddHealthInfo(mode, modeConfig.Enable, modeConfig.Tip, modeConfig.ConfigValue, modeConfig.Condition);
                }
            }

            // ------------------------------------------------Audio------------------------------------------------
            ViewerConst.GetSingletonInstance <AudioHealthInfoManager>().Clear();
            foreach (string mode in ViewerConst.GetSingletonInstance <AudioViewerModeManager>().GetMode())
            {
                HealthConfig.ModeConfig modeConfig = configJson.GetModeConfig("Audio", mode);
                if (modeConfig != null)
                {
                    ViewerConst.GetSingletonInstance <AudioHealthInfoManager>().AddHealthInfo(mode, modeConfig.Enable, modeConfig.Tip, modeConfig.ConfigValue, modeConfig.Condition);
                }
            }
        }
Пример #2
0
 private void InitHealthData()
 {
     HealthConfig.Instance().Init();
     HealthConfigPopup.s_healthConfigs = HealthConfig.Instance().GetHealthConfigName();
     LoadHealthConfig();
 }