Pause() private method

private Pause ( ) : void
return void
        void DoToolbarGUI()
        {
            GUILayout.BeginHorizontal("Toolbar");

            using (new EditorGUI.DisabledScope(m_ParticleEffectUI == null))
            {
                if (!EditorApplication.isPlaying)
                {
                    bool isPlaying = false;

                    if (m_ParticleEffectUI != null)
                    {
                        isPlaying = m_ParticleEffectUI.IsPlaying();
                    }

                    if (GUILayout.Button(isPlaying ? ParticleEffectUI.texts.pause : ParticleEffectUI.texts.play, "ToolbarButton", GUILayout.Width(65)))
                    {
                        if (m_ParticleEffectUI != null)
                        {
                            if (isPlaying)
                            {
                                m_ParticleEffectUI.Pause();
                            }
                            else
                            {
                                m_ParticleEffectUI.Play();
                            }
                        }
                        Repaint(); // we switch texts
                    }

                    if (GUILayout.Button(ParticleEffectUI.texts.stop, "ToolbarButton"))
                    {
                        if (m_ParticleEffectUI != null)
                        {
                            m_ParticleEffectUI.Stop();
                        }
                    }
                }
                else
                {
                    // In play mode we have pulse play behavior
                    if (GUILayout.Button(ParticleEffectUI.texts.play, "ToolbarButton", GUILayout.Width(65)))
                    {
                        if (m_ParticleEffectUI != null)
                        {
                            m_ParticleEffectUI.Stop();
                            m_ParticleEffectUI.Play();
                        }
                    }
                    if (GUILayout.Button(ParticleEffectUI.texts.stop, "ToolbarButton"))
                    {
                        if (m_ParticleEffectUI != null)
                        {
                            m_ParticleEffectUI.Stop();
                        }
                    }
                }

                GUILayout.FlexibleSpace();

                // Resimulation toggle
                ParticleSystemEditorUtils.resimulation = GUILayout.Toggle(ParticleSystemEditorUtils.resimulation, ParticleEffectUI.texts.resimulation, "ToolbarButton");

                // Bounds toggle
                ParticleEffectUI.m_ShowBounds = GUILayout.Toggle(ParticleEffectUI.m_ShowBounds, ParticleEffectUI.texts.showBounds, "ToolbarButton");

                // Editor layout
                if (GUILayout.Button(ParticleEffectUI.m_VerticalLayout ? s_Icons[0] : s_Icons[1], "ToolbarButton"))
                {
                    ParticleEffectUI.m_VerticalLayout = !ParticleEffectUI.m_VerticalLayout;
                    EditorPrefs.SetBool("ShurikenVerticalLayout", ParticleEffectUI.m_VerticalLayout);
                    {
                        Clear();
                    }
                }

                // Lock toggle
                GUILayout.BeginVertical();
                GUILayout.Space(2);
                ParticleSystem lockedParticleSystem = ParticleSystemEditorUtils.lockedParticleSystem;
                bool           isLocked             = lockedParticleSystem != null;
                bool           newLocked            = GUILayout.Toggle(isLocked, s_Texts.lockParticleSystem, "IN LockButton");
                if (isLocked != newLocked)
                {
                    if (m_ParticleEffectUI != null && m_Target != null)
                    {
                        if (newLocked)
                        {
                            ParticleSystemEditorUtils.lockedParticleSystem = m_Target;
                        }
                        else
                        {
                            ParticleSystemEditorUtils.lockedParticleSystem = null;
                        }
                    }
                }
                GUILayout.EndVertical();
            }

            GUILayout.EndHorizontal();
        }