UnityEditor.ParticleEffectUI.SetAllModulesVisible C# (CSharp) Method

SetAllModulesVisible() private method

private SetAllModulesVisible ( bool showAll ) : void
showAll bool
return void
        internal void SetAllModulesVisible(bool showAll)
        {
            EditorPrefs.SetBool("ParticleSystemShowAllModules", showAll);
            foreach (ParticleSystemUI mui in this.m_Emitters)
            {
                for (int i = 0; i < mui.m_Modules.Length; i++)
                {
                    ModuleUI eui = mui.m_Modules[i];
                    if (eui != null)
                    {
                        if (showAll)
                        {
                            if (!eui.visibleUI)
                            {
                                eui.visibleUI = true;
                            }
                        }
                        else
                        {
                            bool flag = true;
                            if ((eui is RendererModuleUI) && (mui.GetParticleSystemRenderer() != null))
                            {
                                flag = false;
                            }
                            if (flag && !eui.enabled)
                            {
                                eui.visibleUI = false;
                            }
                        }
                    }
                }
            }
        }

Usage Example

        void AddModuleCallback(object obj)
        {
            int index = (int)obj;

            if (index >= 0 && index < m_Modules.Length)
            {
                if (index == m_Modules.Length - 1)
                {
                    InitRendererUI();
                }
                else
                {
                    m_Modules[index].enabled = true;
                    m_Modules[index].foldout = true;
                }
            }
            else
            {
                m_ParticleEffectUI.SetAllModulesVisible(!ParticleEffectUI.GetAllModulesVisible());
            }
            ApplyProperties();
        }