UnityEditor.ParticleSystemUI.OnSceneGUI C# (CSharp) Method

OnSceneGUI() public method

public OnSceneGUI ( ) : void
return void
        public void OnSceneGUI()
        {
            if ((this.m_Modules != null) && (this.m_ParticleSystem != null))
            {
                if (this.m_ParticleSystem.particleCount > 0)
                {
                    ParticleSystemRenderer particleSystemRenderer = this.GetParticleSystemRenderer();
                    if (ParticleEffectUI.m_ShowBounds)
                    {
                        Color color = Handles.color;
                        Handles.color = Color.yellow;
                        Bounds bounds = particleSystemRenderer.bounds;
                        Handles.DrawWireCube(bounds.center, bounds.size);
                        Handles.color = color;
                    }
                    EditorUtility.SetSelectedRenderState(particleSystemRenderer, !ParticleEffectUI.m_ShowWireframe ? EditorSelectedRenderState.Hidden : EditorSelectedRenderState.Wireframe);
                }
                this.UpdateProperties();
                InitialModuleUI initial = (InitialModuleUI) this.m_Modules[0];
                foreach (ModuleUI eui2 in this.m_Modules)
                {
                    if ((((eui2 != null) && eui2.visibleUI) && eui2.enabled) && eui2.foldout)
                    {
                        eui2.OnSceneGUI(this.m_ParticleSystem, initial);
                    }
                }
                this.ApplyProperties();
            }
        }

Usage Example

示例#1
0
 public void OnSceneGUI()
 {
     ParticleSystemUI[] emitters = this.m_Emitters;
     for (int i = 0; i < emitters.Length; i++)
     {
         ParticleSystemUI particleSystemUI = emitters[i];
         particleSystemUI.OnSceneGUI();
     }
 }