SetSelectedRenderState() private method

private SetSelectedRenderState ( Renderer renderer, EditorSelectedRenderState renderState ) : void
renderer Renderer
renderState EditorSelectedRenderState
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];
         ModuleUI[]      modules = this.m_Modules;
         for (int i = 0; i < modules.Length; i++)
         {
             ModuleUI moduleUI = modules[i];
             if (moduleUI != null && moduleUI.visibleUI && moduleUI.enabled)
             {
                 if (moduleUI.foldout)
                 {
                     moduleUI.OnSceneGUI(this.m_ParticleSystem, initial);
                 }
             }
         }
         this.ApplyProperties();
     }
 }
        private void InitRendererUI()
        {
            List <ParticleSystemRenderer> list = new List <ParticleSystemRenderer>();

            ParticleSystem[] particleSystems = this.m_ParticleSystems;
            for (int i = 0; i < particleSystems.Length; i++)
            {
                ParticleSystem         particleSystem = particleSystems[i];
                ParticleSystemRenderer component      = particleSystem.GetComponent <ParticleSystemRenderer>();
                if (component == null)
                {
                    particleSystem.gameObject.AddComponent <ParticleSystemRenderer>();
                }
                list.Add(particleSystem.GetComponent <ParticleSystemRenderer>());
            }
            if (list.Count > 0)
            {
                this.m_RendererSerializedObject           = new SerializedObject(list.ToArray());
                this.m_Modules[this.m_Modules.Length - 1] = new RendererModuleUI(this, this.m_RendererSerializedObject, ParticleSystemUI.s_ModuleNames[ParticleSystemUI.s_ModuleNames.Length - 1]);
                foreach (ParticleSystemRenderer current in list)
                {
                    EditorUtility.SetSelectedRenderState(current, (!ParticleEffectUI.m_ShowWireframe) ? EditorSelectedRenderState.Hidden : EditorSelectedRenderState.Wireframe);
                }
            }
        }
Example #3
0
 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();
     }
 }
Example #4
0
        private void InitRendererUI()
        {
            if (this.GetParticleSystemRenderer() == null)
            {
                this.m_ParticleSystem.gameObject.AddComponent <ParticleSystemRenderer>();
            }
            ParticleSystemRenderer particleSystemRenderer = this.GetParticleSystemRenderer();

            if (particleSystemRenderer != null)
            {
                this.m_RendererSerializedObject           = new SerializedObject(particleSystemRenderer);
                this.m_Modules[this.m_Modules.Length - 1] = new RendererModuleUI(this, this.m_RendererSerializedObject, s_ModuleNames[s_ModuleNames.Length - 1]);
                EditorUtility.SetSelectedRenderState(particleSystemRenderer, !ParticleEffectUI.m_ShowWireframe ? EditorSelectedRenderState.Hidden : EditorSelectedRenderState.Wireframe);
            }
        }
 public void OnSceneViewGUI()
 {
     if (this.m_Modules != null)
     {
         ParticleSystem[] particleSystems = this.m_ParticleSystems;
         for (int i = 0; i < particleSystems.Length; i++)
         {
             ParticleSystem particleSystem = particleSystems[i];
             if (particleSystem.particleCount > 0)
             {
                 ParticleSystemRenderer component = particleSystem.GetComponent <ParticleSystemRenderer>();
                 if (ParticleEffectUI.m_ShowBounds)
                 {
                     Color color = Handles.color;
                     Handles.color = Color.yellow;
                     Bounds bounds = component.bounds;
                     Handles.DrawWireCube(bounds.center, bounds.size);
                     Handles.color = color;
                 }
                 EditorUtility.SetSelectedRenderState(component, (!ParticleEffectUI.m_ShowWireframe) ? EditorSelectedRenderState.Hidden : EditorSelectedRenderState.Wireframe);
             }
         }
         this.UpdateProperties();
         ModuleUI[] modules = this.m_Modules;
         for (int j = 0; j < modules.Length; j++)
         {
             ModuleUI moduleUI = modules[j];
             if (moduleUI != null && moduleUI.visibleUI && moduleUI.enabled)
             {
                 if (moduleUI.foldout)
                 {
                     moduleUI.OnSceneViewGUI();
                 }
             }
         }
         this.ApplyProperties();
     }
 }
Example #6
0
 public static void SetSelectedWireframeHidden(Renderer renderer, bool enabled)
 {
     EditorUtility.SetSelectedRenderState(renderer, (!enabled) ? (EditorSelectedRenderState.Wireframe | EditorSelectedRenderState.Highlight) : EditorSelectedRenderState.Hidden);
 }