UnityEditor.ParticleEffectUI.PlayBackTimeGUI C# (CSharp) Method

PlayBackTimeGUI() private method

private PlayBackTimeGUI ( ParticleSystem root ) : void
root UnityEngine.ParticleSystem
return void
        internal void PlayBackTimeGUI(ParticleSystem root)
        {
            if (root == null)
            {
                root = ParticleSystemEditorUtils.GetRoot(this.m_SelectedParticleSystem);
            }
            EventType type = Event.current.type;
            int hotControl = GUIUtility.hotControl;
            string kFloatFieldFormatString = EditorGUI.kFloatFieldFormatString;
            EditorGUI.BeginChangeCheck();
            EditorGUI.kFloatFieldFormatString = s_Texts.secondsFloatFieldFormatString;
            float a = EditorGUILayout.FloatField(s_Texts.previewTime, ParticleSystemEditorUtils.editorPlaybackTime, new GUILayoutOption[0]);
            EditorGUI.kFloatFieldFormatString = kFloatFieldFormatString;
            if (EditorGUI.EndChangeCheck())
            {
                if (type == EventType.MouseDrag)
                {
                    ParticleSystemEditorUtils.editorIsScrubbing = true;
                    float editorSimulationSpeed = ParticleSystemEditorUtils.editorSimulationSpeed;
                    float editorPlaybackTime = ParticleSystemEditorUtils.editorPlaybackTime;
                    float num5 = a - editorPlaybackTime;
                    a = editorPlaybackTime + (num5 * (0.05f * editorSimulationSpeed));
                }
                ParticleSystemEditorUtils.editorPlaybackTime = Mathf.Max(a, 0f);
                if (root.isStopped)
                {
                    root.Play();
                    root.Pause();
                }
                ParticleSystemEditorUtils.PerformCompleteResimulation();
            }
            if ((type == EventType.MouseDown) && (GUIUtility.hotControl != hotControl))
            {
                this.m_IsDraggingTimeHotControlID = GUIUtility.hotControl;
                ParticleSystemEditorUtils.editorIsScrubbing = true;
            }
            if ((this.m_IsDraggingTimeHotControlID != -1) && (GUIUtility.hotControl != this.m_IsDraggingTimeHotControlID))
            {
                this.m_IsDraggingTimeHotControlID = -1;
                ParticleSystemEditorUtils.editorIsScrubbing = false;
            }
            EditorGUILayout.FloatField(s_Texts.particleCount, (float) this.m_SelectedParticleSystem.particleCount, new GUILayoutOption[0]);
            int count = 0;
            if (this.m_SelectedParticleSystem.CountSubEmitterParticles(ref count))
            {
                EditorGUILayout.FloatField(s_Texts.subEmitterParticleCount, (float) count, new GUILayoutOption[0]);
            }
        }