OnGUI() public method

public OnGUI ( ParticleSystem root, float width, bool fixedWidth ) : void
root UnityEngine.ParticleSystem
width float
fixedWidth bool
return void
Exemplo n.º 1
0
        private void InspectorParticleSystemGUI()
        {
            GUILayout.BeginVertical(ParticleSystemStyles.Get().effectBgStyle);
            {
                ParticleSystem selectedSystem = (m_SelectedParticleSystems.Count > 0) ? m_SelectedParticleSystems[0] : null;
                if (selectedSystem != null)
                {
                    ParticleSystemUI psUI = m_Emitters.FirstOrDefault(o => o.m_ParticleSystems[0] == selectedSystem);
                    if (psUI != null)
                    {
                        float width = GUIClip.visibleRect.width - 18; // -10 is effect_bg padding, -8 is inspector padding
                        psUI.OnGUI(width, false);
                    }
                }
            }

            GUILayout.EndVertical();
            GUILayout.FlexibleSpace();

            HandleKeyboardShortcuts();
        }
Exemplo n.º 2
0
        private void SingleParticleSystemGUI()
        {
            ParticleSystem root = ParticleSystemEditorUtils.GetRoot(this.m_SelectedParticleSystem);

            GUILayout.BeginVertical(ParticleSystemStyles.Get().effectBgStyle, new GUILayoutOption[0]);
            ParticleSystemUI particleSystemUIForParticleSystem = this.GetParticleSystemUIForParticleSystem(this.m_SelectedParticleSystem);

            if (particleSystemUIForParticleSystem != null)
            {
                float width = GUIClip.visibleRect.width - 18f;
                particleSystemUIForParticleSystem.OnGUI(root, width, false);
            }
            GUILayout.EndVertical();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            ParticleSystemEditorUtils.editorResimulation = GUILayout.Toggle(ParticleSystemEditorUtils.editorResimulation, s_Texts.resimulation, EditorStyles.toggle, new GUILayoutOption[0]);
            m_ShowWireframe = GUILayout.Toggle(m_ShowWireframe, "Wireframe", EditorStyles.toggle, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            this.HandleKeyboardShortcuts(root);
        }
Exemplo n.º 3
0
        private void InspectorParticleSystemGUI()
        {
            GUILayout.BeginVertical(ParticleSystemStyles.Get().effectBgStyle, new GUILayoutOption[0]);
            ParticleSystem selectedSystem = (this.m_SelectedParticleSystems.Count <= 0) ? null : this.m_SelectedParticleSystems[0];

            if (selectedSystem != null)
            {
                ParticleSystemUI particleSystemUI = this.m_Emitters.FirstOrDefault((ParticleSystemUI o) => o.m_ParticleSystems[0] == selectedSystem);
                if (particleSystemUI != null)
                {
                    float width = GUIClip.visibleRect.width - 18f;
                    particleSystemUI.OnGUI(width, false);
                }
            }
            GUILayout.EndVertical();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            ParticleSystemEditorUtils.editorResimulation = GUILayout.Toggle(ParticleSystemEditorUtils.editorResimulation, ParticleEffectUI.s_Texts.resimulation, EditorStyles.toggle, new GUILayoutOption[0]);
            ParticleEffectUI.m_ShowWireframe             = GUILayout.Toggle(ParticleEffectUI.m_ShowWireframe, ParticleEffectUI.texts.wireframe, EditorStyles.toggle, new GUILayoutOption[0]);
            ParticleEffectUI.m_ShowBounds = GUILayout.Toggle(ParticleEffectUI.m_ShowBounds, ParticleEffectUI.texts.bounds, EditorStyles.toggle, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            this.HandleKeyboardShortcuts();
        }