public GameObject CreateParticleSystem(ParticleSystem parentOfNewParticleSystem, SubModuleUI.SubEmitterType defaultType)
{
Type[] components = new Type[] { typeof(ParticleSystem) };
GameObject obj2 = new GameObject(this.GetNextParticleSystemName(), components);
if (obj2 != null)
{
if (parentOfNewParticleSystem != null)
{
obj2.transform.parent = parentOfNewParticleSystem.transform;
}
obj2.transform.localPosition = Vector3.zero;
obj2.transform.localRotation = Quaternion.identity;
ParticleSystem component = obj2.GetComponent<ParticleSystem>();
if (defaultType != SubModuleUI.SubEmitterType.None)
{
component.SetupDefaultType((int) defaultType);
}
SessionState.SetFloat("CurrentEmitterAreaScroll", this.m_EmitterAreaScrollPos.x);
Material[] materialArray1 = new Material[2];
materialArray1[0] = AssetDatabase.GetBuiltinExtraResource<Material>("Default-Particle.mat");
obj2.GetComponent<ParticleSystemRenderer>().materials = materialArray1;
return obj2;
}
return null;
}