public bool InitializeIfNeeded(ParticleSystem shuriken)
{
ParticleSystem root = ParticleSystemEditorUtils.GetRoot(shuriken);
if (root == null)
{
return false;
}
ParticleSystem[] particleSystems = GetParticleSystems(root);
if ((root == this.GetRoot()) && (((this.m_ParticleSystemCurveEditor != null) && (this.m_Emitters != null)) && (particleSystems.Length == this.m_Emitters.Length)))
{
this.m_SelectedParticleSystem = shuriken;
if (this.IsShowOnlySelectedMode())
{
this.RefreshShowOnlySelected();
}
return false;
}
if (this.m_ParticleSystemCurveEditor != null)
{
this.Clear();
}
this.m_SelectedParticleSystem = shuriken;
ParticleSystemEditorUtils.PerformCompleteResimulation();
this.m_ParticleSystemCurveEditor = new ParticleSystemCurveEditor();
this.m_ParticleSystemCurveEditor.Init();
this.m_EmitterAreaWidth = EditorPrefs.GetFloat("ParticleSystemEmitterAreaWidth", k_MinEmitterAreaSize.x);
this.m_CurveEditorAreaHeight = EditorPrefs.GetFloat("ParticleSystemCurveEditorAreaHeight", k_MinCurveAreaSize.y);
this.InitAllEmitters(particleSystems);
this.m_ShowOnlySelectedMode = (this.m_Owner is ParticleSystemWindow) && SessionState.GetBool("ShowSelected" + root.GetInstanceID(), false);
if (this.IsShowOnlySelectedMode())
{
this.RefreshShowOnlySelected();
}
this.m_EmitterAreaScrollPos.x = SessionState.GetFloat("CurrentEmitterAreaScroll", 0f);
if (this.ShouldManagePlaybackState(root))
{
Vector3 vector3 = SessionState.GetVector3("SimulationState" + root.GetInstanceID(), Vector3.zero);
if (root.GetInstanceID() == ((int) vector3.x))
{
float z = vector3.z;
if (z > 0f)
{
ParticleSystemEditorUtils.editorPlaybackTime = z;
}
}
this.Play();
}
return true;
}