public GameObject CreateParticleSystem(ParticleSystem parentOfNewParticleSystem, SubModuleUI.SubEmitterType defaultType)
{
string nextParticleSystemName = this.GetNextParticleSystemName();
GameObject gameObject = new GameObject(nextParticleSystemName, new Type[]
{
typeof(ParticleSystem)
});
if (gameObject)
{
if (parentOfNewParticleSystem)
{
gameObject.transform.parent = parentOfNewParticleSystem.transform;
}
gameObject.transform.localPosition = Vector3.zero;
gameObject.transform.localRotation = Quaternion.identity;
ParticleSystem component = gameObject.GetComponent <ParticleSystem>();
if (defaultType != SubModuleUI.SubEmitterType.None)
{
component.SetupDefaultType((int)defaultType);
}
SessionState.SetFloat("CurrentEmitterAreaScroll", this.m_EmitterAreaScrollPos.x);
return(gameObject);
}
return(null);
}