private void CheckIfChild(Object subEmitter)
{
if (!(subEmitter != (Object)null))
{
return;
}
ParticleSystem root = this.m_ParticleSystemUI.m_ParticleEffectUI.GetRoot();
if (SubModuleUI.IsChild(subEmitter as ParticleSystem, root) || !EditorUtility.DisplayDialog("Reparent GameObjects", string.Format("The assigned sub emitter is not a child of the current root particle system GameObject: '{0}' and is therefore NOT considered a part of the current effect. Do you want to reparent it?", (object)root.gameObject.name), "Yes, Reparent", "No"))
{
return;
}
if (EditorUtility.IsPersistent(subEmitter))
{
GameObject gameObject = Object.Instantiate(subEmitter) as GameObject;
if (!((Object)gameObject != (Object)null))
{
return;
}
gameObject.transform.parent = this.m_ParticleSystemUI.m_ParticleSystem.transform;
gameObject.transform.localPosition = Vector3.zero;
gameObject.transform.localRotation = Quaternion.identity;
}
else
{
ParticleSystem particleSystem = subEmitter as ParticleSystem;
if (!(bool)((Object)particleSystem))
{
return;
}
Undo.SetTransformParent(this.m_ParticleSystemUI.m_ParticleSystem.transform, particleSystem.gameObject.transform.transform, "Reparent sub emitter");
}
}