public override void OnInspectorGUI(ParticleSystem s)
{
if (s_Texts == null)
{
s_Texts = new Texts();
}
ModuleUI.GUIFloat(s_Texts.duration, this.m_LengthInSec, "f2", new GUILayoutOption[0]);
this.m_LengthInSec.floatValue = Mathf.Min(100000f, Mathf.Max(0f, this.m_LengthInSec.floatValue));
bool boolValue = this.m_Looping.boolValue;
ModuleUI.GUIToggle(s_Texts.looping, this.m_Looping, new GUILayoutOption[0]);
if ((this.m_Looping.boolValue && !boolValue) && (s.time >= this.m_LengthInSec.floatValue))
{
s.time = 0f;
}
using (new EditorGUI.DisabledScope(!this.m_Looping.boolValue))
{
ModuleUI.GUIToggle(s_Texts.prewarm, this.m_Prewarm, new GUILayoutOption[0]);
}
using (new EditorGUI.DisabledScope(this.m_Prewarm.boolValue && this.m_Looping.boolValue))
{
ModuleUI.GUIMinMaxCurve(s_Texts.startDelay, this.m_StartDelay, new GUILayoutOption[0]);
}
ModuleUI.GUIMinMaxCurve(s_Texts.lifetime, this.m_LifeTime, new GUILayoutOption[0]);
ModuleUI.GUIMinMaxCurve(s_Texts.speed, this.m_Speed, new GUILayoutOption[0]);
EditorGUI.BeginChangeCheck();
bool flag2 = ModuleUI.GUIToggle(s_Texts.size3D, this.m_Size3D, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
if (flag2)
{
this.m_SizeX.RemoveCurveFromEditor();
}
else
{
this.m_SizeX.RemoveCurveFromEditor();
this.m_SizeY.RemoveCurveFromEditor();
this.m_SizeZ.RemoveCurveFromEditor();
}
}
MinMaxCurveState state = this.m_SizeX.state;
this.m_SizeY.state = state;
this.m_SizeZ.state = state;
if (flag2)
{
this.m_SizeX.m_DisplayName = s_Texts.x;
base.GUITripleMinMaxCurve(GUIContent.none, s_Texts.x, this.m_SizeX, s_Texts.y, this.m_SizeY, s_Texts.z, this.m_SizeZ, null, new GUILayoutOption[0]);
}
else
{
this.m_SizeX.m_DisplayName = s_Texts.size;
ModuleUI.GUIMinMaxCurve(s_Texts.size, this.m_SizeX, new GUILayoutOption[0]);
}
EditorGUI.BeginChangeCheck();
bool flag3 = ModuleUI.GUIToggle(s_Texts.rotation3D, this.m_Rotation3D, new GUILayoutOption[0]);
if (EditorGUI.EndChangeCheck())
{
if (flag3)
{
this.m_RotationZ.RemoveCurveFromEditor();
}
else
{
this.m_RotationX.RemoveCurveFromEditor();
this.m_RotationY.RemoveCurveFromEditor();
this.m_RotationZ.RemoveCurveFromEditor();
}
}
state = this.m_RotationZ.state;
this.m_RotationY.state = state;
this.m_RotationX.state = state;
if (flag3)
{
this.m_RotationZ.m_DisplayName = s_Texts.z;
base.GUITripleMinMaxCurve(GUIContent.none, s_Texts.x, this.m_RotationX, s_Texts.y, this.m_RotationY, s_Texts.z, this.m_RotationZ, null, new GUILayoutOption[0]);
}
else
{
this.m_RotationZ.m_DisplayName = s_Texts.rotation;
ModuleUI.GUIMinMaxCurve(s_Texts.rotation, this.m_RotationZ, new GUILayoutOption[0]);
}
ModuleUI.GUIFloat(s_Texts.randomizeRotationDirection, this.m_RandomizeRotationDirection, new GUILayoutOption[0]);
base.GUIMinMaxGradient(s_Texts.color, this.m_Color, new GUILayoutOption[0]);
ModuleUI.GUIMinMaxCurve(s_Texts.gravity, this.m_GravityModifier, new GUILayoutOption[0]);
string[] options = new string[] { "Local", "World", "Custom" };
if ((ModuleUI.GUIPopup(s_Texts.simulationSpace, this.m_SimulationSpace, options, new GUILayoutOption[0]) == 2) && (this.m_CustomSimulationSpace != null))
{
ModuleUI.GUIObject(s_Texts.customSimulationSpace, this.m_CustomSimulationSpace, new GUILayoutOption[0]);
}
ModuleUI.GUIFloat(s_Texts.simulationSpeed, this.m_SimulationSpeed, new GUILayoutOption[0]);
if ((base.m_ParticleSystemUI.m_ParticleSystem.shape.shapeType != ParticleSystemShapeType.SkinnedMeshRenderer) && (base.m_ParticleSystemUI.m_ParticleSystem.shape.shapeType != ParticleSystemShapeType.MeshRenderer))
{
string[] textArray2 = new string[] { "Hierarchy", "Local", "Shape" };
ModuleUI.GUIPopup(s_Texts.scalingMode, this.m_ScalingMode, textArray2, new GUILayoutOption[0]);
}
bool flag4 = this.m_PlayOnAwake.boolValue;
bool newPlayOnAwake = ModuleUI.GUIToggle(s_Texts.autoplay, this.m_PlayOnAwake, new GUILayoutOption[0]);
if (flag4 != newPlayOnAwake)
{
base.m_ParticleSystemUI.m_ParticleEffectUI.PlayOnAwakeChanged(newPlayOnAwake);
}
ModuleUI.GUIInt(s_Texts.maxParticles, this.m_MaxNumParticles, new GUILayoutOption[0]);
if (!ModuleUI.GUIToggle(s_Texts.autoRandomSeed, this.m_AutoRandomSeed, new GUILayoutOption[0]))
{
if (base.m_ParticleSystemUI.m_ParticleEffectUI.m_Owner is ParticleSystemInspector)
{
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
ModuleUI.GUIInt(s_Texts.randomSeed, this.m_RandomSeed, new GUILayoutOption[0]);
GUILayoutOption[] optionArray1 = new GUILayoutOption[] { GUILayout.Width(60f) };
if (GUILayout.Button("Reseed", EditorStyles.miniButton, optionArray1))
{
this.m_RandomSeed.intValue = base.m_ParticleSystemUI.m_ParticleSystem.GenerateRandomSeed();
}
GUILayout.EndHorizontal();
}
else
{
ModuleUI.GUIInt(s_Texts.randomSeed, this.m_RandomSeed, new GUILayoutOption[0]);
if (GUILayout.Button("Reseed", EditorStyles.miniButton, new GUILayoutOption[0]))
{
this.m_RandomSeed.intValue = base.m_ParticleSystemUI.m_ParticleSystem.GenerateRandomSeed();
}
}
}
}