コード例 #1
0
        private bool RenderFeatureSection()
        {
            RenderSectionTitle("Features", "FeatureSectionIcon");

            bool didChangeProfile = false;

            string[] rebuildSkyKeywords = new string[]
            {
                ShaderKeywords.StarLayer1,
                ShaderKeywords.StarLayer2,
                ShaderKeywords.StarLayer3
            };

            if (m_Sections.ContainsKey(ProfileSectionKeys.FeaturesSectionKey) == false)
            {
                Debug.LogError("Shader definition is missing a features dictionary");
                return(didChangeProfile);
            }

            ProfileFeatureSection section = m_Sections[ProfileSectionKeys.FeaturesSectionKey];

            foreach (ProfileFeatureDefinition def in section.featureDefinitions)
            {
                if (def.dependsOnFeature != null)
                {
                    if (m_Profile.IsFeatureEnabled(def.dependsOnFeature) != def.dependsOnValue)
                    {
                        m_Profile.SetFeatureEnabled(def.featureKey, false);
                        didChangeProfile = true;
                        continue;
                    }
                }

                bool valueChanged;
                RenderFeatureCheckbox(
                    def,
                    m_Profile.IsFeatureEnabled(def.featureKey),
                    out valueChanged);

                if (valueChanged && rebuildSkyKeywords.Contains(def.shaderKeyword))
                {
                    RebuildSkySystem();
                }

                if (valueChanged)
                {
                    didChangeProfile = true;
                }
            }

            return(didChangeProfile);
        }