GUIBoolAsPopup() публичный статический Метод

public static GUIBoolAsPopup ( GUIContent label, UnityEditor.SerializedProperty boolProp, string options ) : bool
label UnityEngine.GUIContent
boolProp UnityEditor.SerializedProperty
options string
Результат bool
Пример #1
0
 public override void OnInspectorGUI(ParticleSystem s)
 {
     if (VelocityModuleUI.s_Texts == null)
     {
         VelocityModuleUI.s_Texts = new VelocityModuleUI.Texts();
     }
     base.GUITripleMinMaxCurve(GUIContent.none, VelocityModuleUI.s_Texts.x, this.m_X, VelocityModuleUI.s_Texts.y, this.m_Y, VelocityModuleUI.s_Texts.z, this.m_Z, null);
     ModuleUI.GUIBoolAsPopup(VelocityModuleUI.s_Texts.space, this.m_InWorldSpace, VelocityModuleUI.s_Texts.spaces);
 }
Пример #2
0
 public override void OnInspectorGUI(InitialModuleUI initial)
 {
     if (VelocityModuleUI.s_Texts == null)
     {
         VelocityModuleUI.s_Texts = new VelocityModuleUI.Texts();
     }
     base.GUITripleMinMaxCurve(GUIContent.none, VelocityModuleUI.s_Texts.x, this.m_X, VelocityModuleUI.s_Texts.y, this.m_Y, VelocityModuleUI.s_Texts.z, this.m_Z, null, new GUILayoutOption[0]);
     ModuleUI.GUIBoolAsPopup(VelocityModuleUI.s_Texts.space, this.m_InWorldSpace, VelocityModuleUI.s_Texts.spaces, new GUILayoutOption[0]);
 }
Пример #3
0
 public override void OnInspectorGUI(ParticleSystem s)
 {
     if (s_Texts == null)
     {
         s_Texts = new Texts();
     }
     base.GUITripleMinMaxCurve(GUIContent.none, s_Texts.x, this.m_X, s_Texts.y, this.m_Y, s_Texts.z, this.m_Z, null, new GUILayoutOption[0]);
     ModuleUI.GUIBoolAsPopup(s_Texts.space, this.m_InWorldSpace, s_Texts.spaces, new GUILayoutOption[0]);
 }
Пример #4
0
        public override void OnInspectorGUI(InitialModuleUI initial)
        {
            MinMaxCurveState state = this.m_X.state;

            base.GUITripleMinMaxCurve(GUIContent.none, ForceModuleUI.s_Texts.x, this.m_X, ForceModuleUI.s_Texts.y, this.m_Y, ForceModuleUI.s_Texts.z, this.m_Z, this.m_RandomizePerFrame, new GUILayoutOption[0]);
            ModuleUI.GUIBoolAsPopup(ForceModuleUI.s_Texts.space, this.m_InWorldSpace, ForceModuleUI.s_Texts.spaces, new GUILayoutOption[0]);
            using (new EditorGUI.DisabledScope(state != MinMaxCurveState.k_TwoScalars && state != MinMaxCurveState.k_TwoCurves))
            {
                ModuleUI.GUIToggle(ForceModuleUI.s_Texts.randomizePerFrame, this.m_RandomizePerFrame, new GUILayoutOption[0]);
            }
        }
Пример #5
0
 public override void OnInspectorGUI(InitialModuleUI initial)
 {
     base.GUITripleMinMaxCurve(GUIContent.none, VelocityModuleUI.s_Texts.linearX, this.m_X, VelocityModuleUI.s_Texts.y, this.m_Y, VelocityModuleUI.s_Texts.z, this.m_Z, null, new GUILayoutOption[0]);
     EditorGUI.indentLevel++;
     ModuleUI.GUIBoolAsPopup(VelocityModuleUI.s_Texts.linearSpace, this.m_InWorldSpace, VelocityModuleUI.s_Texts.spaces, new GUILayoutOption[0]);
     EditorGUI.indentLevel--;
     base.GUITripleMinMaxCurve(GUIContent.none, VelocityModuleUI.s_Texts.orbitalX, this.m_OrbitalX, VelocityModuleUI.s_Texts.y, this.m_OrbitalY, VelocityModuleUI.s_Texts.z, this.m_OrbitalZ, null, new GUILayoutOption[0]);
     base.GUITripleMinMaxCurve(GUIContent.none, VelocityModuleUI.s_Texts.orbitalOffsetX, this.m_OrbitalOffsetX, VelocityModuleUI.s_Texts.y, this.m_OrbitalOffsetY, VelocityModuleUI.s_Texts.z, this.m_OrbitalOffsetZ, null, new GUILayoutOption[0]);
     EditorGUI.indentLevel++;
     ModuleUI.GUIMinMaxCurve(VelocityModuleUI.s_Texts.radial, this.m_Radial, new GUILayoutOption[0]);
     EditorGUI.indentLevel--;
     ModuleUI.GUIMinMaxCurve(VelocityModuleUI.s_Texts.speedMultiplier, this.m_SpeedModifier, new GUILayoutOption[0]);
 }
Пример #6
0
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (ForceModuleUI.s_Texts == null)
            {
                ForceModuleUI.s_Texts = new ForceModuleUI.Texts();
            }
            MinMaxCurveState state = this.m_X.state;

            this.GUITripleMinMaxCurve(GUIContent.none, ForceModuleUI.s_Texts.x, this.m_X, ForceModuleUI.s_Texts.y, this.m_Y, ForceModuleUI.s_Texts.z, this.m_Z, this.m_RandomizePerFrame);
            ModuleUI.GUIBoolAsPopup(ForceModuleUI.s_Texts.space, this.m_InWorldSpace, ForceModuleUI.s_Texts.spaces);
            EditorGUI.BeginDisabledGroup(state != MinMaxCurveState.k_TwoScalars && state != MinMaxCurveState.k_TwoCurves);
            ModuleUI.GUIToggle(ForceModuleUI.s_Texts.randomizePerFrame, this.m_RandomizePerFrame);
            EditorGUI.EndDisabledGroup();
        }
Пример #7
0
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (s_Texts == null)
            {
                s_Texts = new Texts();
            }
            MinMaxCurveState state = this.m_X.state;

            base.GUITripleMinMaxCurve(GUIContent.none, s_Texts.x, this.m_X, s_Texts.y, this.m_Y, s_Texts.z, this.m_Z, this.m_RandomizePerFrame, new GUILayoutOption[0]);
            ModuleUI.GUIBoolAsPopup(s_Texts.space, this.m_InWorldSpace, s_Texts.spaces, new GUILayoutOption[0]);
            using (new EditorGUI.DisabledScope((state != MinMaxCurveState.k_TwoScalars) && (state != MinMaxCurveState.k_TwoCurves)))
            {
                ModuleUI.GUIToggle(s_Texts.randomizePerFrame, this.m_RandomizePerFrame, new GUILayoutOption[0]);
            }
        }
Пример #8
0
        public override void OnInspectorGUI(InitialModuleUI initial)
        {
            EditorGUI.BeginChangeCheck();
            bool flag = ModuleUI.GUIToggle(ClampVelocityModuleUI.s_Texts.separateAxes, this.m_SeparateAxes, new GUILayoutOption[0]);

            if (EditorGUI.EndChangeCheck())
            {
                if (flag)
                {
                    this.m_Magnitude.RemoveCurveFromEditor();
                }
                else
                {
                    this.m_X.RemoveCurveFromEditor();
                    this.m_Y.RemoveCurveFromEditor();
                    this.m_Z.RemoveCurveFromEditor();
                }
            }
            if (!this.m_X.stateHasMultipleDifferentValues)
            {
                this.m_Y.SetMinMaxState(this.m_X.state, flag);
                this.m_Z.SetMinMaxState(this.m_X.state, flag);
            }
            if (flag)
            {
                base.GUITripleMinMaxCurve(GUIContent.none, ClampVelocityModuleUI.s_Texts.x, this.m_X, ClampVelocityModuleUI.s_Texts.y, this.m_Y, ClampVelocityModuleUI.s_Texts.z, this.m_Z, null, new GUILayoutOption[0]);
                EditorGUI.indentLevel++;
                ModuleUI.GUIBoolAsPopup(ClampVelocityModuleUI.s_Texts.space, this.m_InWorldSpace, ClampVelocityModuleUI.s_Texts.spaces, new GUILayoutOption[0]);
                EditorGUI.indentLevel--;
            }
            else
            {
                ModuleUI.GUIMinMaxCurve(ClampVelocityModuleUI.s_Texts.magnitude, this.m_Magnitude, new GUILayoutOption[0]);
            }
            EditorGUI.indentLevel++;
            ModuleUI.GUIFloat(ClampVelocityModuleUI.s_Texts.dampen, this.m_Dampen, new GUILayoutOption[0]);
            EditorGUI.indentLevel--;
            ModuleUI.GUIMinMaxCurve(ClampVelocityModuleUI.s_Texts.drag, this.m_Drag, new GUILayoutOption[0]);
            EditorGUI.indentLevel++;
            ModuleUI.GUIToggle(ClampVelocityModuleUI.s_Texts.multiplyDragByParticleSize, this.m_MultiplyDragByParticleSize, new GUILayoutOption[0]);
            ModuleUI.GUIToggle(ClampVelocityModuleUI.s_Texts.multiplyDragByParticleVelocity, this.m_MultiplyDragByParticleVelocity, new GUILayoutOption[0]);
            EditorGUI.indentLevel--;
        }
Пример #9
0
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (s_Texts == null)
            {
                s_Texts = new Texts();
            }
            ModuleUI.GUIFloat(s_Texts.duration, this.m_LengthInSec, "f2");
            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);
            if ((this.m_Looping.boolValue && !boolValue) && (s.time >= this.m_LengthInSec.floatValue))
            {
                s.time = 0f;
            }
            EditorGUI.BeginDisabledGroup(!this.m_Looping.boolValue);
            ModuleUI.GUIToggle(s_Texts.prewarm, this.m_Prewarm);
            EditorGUI.EndDisabledGroup();
            EditorGUI.BeginDisabledGroup(this.m_Prewarm.boolValue && this.m_Looping.boolValue);
            ModuleUI.GUIFloat(s_Texts.startDelay, this.m_StartDelay);
            EditorGUI.EndDisabledGroup();
            ModuleUI.GUIMinMaxCurve(s_Texts.lifetime, this.m_LifeTime);
            ModuleUI.GUIMinMaxCurve(s_Texts.speed, this.m_Speed);
            ModuleUI.GUIMinMaxCurve(s_Texts.size, this.m_Size);
            ModuleUI.GUIMinMaxCurve(s_Texts.rotation, this.m_Rotation);
            base.GUIMinMaxGradient(s_Texts.color, this.m_Color);
            ModuleUI.GUIFloat(s_Texts.gravity, this.m_GravityModifier);
            ModuleUI.GUIFloat(s_Texts.inheritvelocity, this.m_InheritVelocity);
            ModuleUI.GUIBoolAsPopup(s_Texts.simulationSpace, this.m_SimulationSpace, s_Texts.simulationSpaces);
            bool flag2          = this.m_PlayOnAwake.boolValue;
            bool newPlayOnAwake = ModuleUI.GUIToggle(s_Texts.autoplay, this.m_PlayOnAwake);

            if (flag2 != newPlayOnAwake)
            {
                base.m_ParticleSystemUI.m_ParticleEffectUI.PlayOnAwakeChanged(newPlayOnAwake);
            }
            ModuleUI.GUIInt(s_Texts.maxParticles, this.m_MaxNumParticles);
        }
Пример #10
0
        public override void OnInspectorGUI(InitialModuleUI initial)
        {
            ModuleUI.GUIFloat(InitialModuleUI.s_Texts.duration, this.m_LengthInSec, "f2", new GUILayoutOption[0]);
            EditorGUI.BeginChangeCheck();
            bool flag = ModuleUI.GUIToggle(InitialModuleUI.s_Texts.looping, this.m_Looping, new GUILayoutOption[0]);

            if (EditorGUI.EndChangeCheck() && flag)
            {
                ParticleSystem[] particleSystems = this.m_ParticleSystemUI.m_ParticleSystems;
                for (int i = 0; i < particleSystems.Length; i++)
                {
                    ParticleSystem particleSystem = particleSystems[i];
                    if (particleSystem.time >= particleSystem.main.duration)
                    {
                        particleSystem.time = 0f;
                    }
                }
            }
            using (new EditorGUI.DisabledScope(!this.m_Looping.boolValue))
            {
                ModuleUI.GUIToggle(InitialModuleUI.s_Texts.prewarm, this.m_Prewarm, new GUILayoutOption[0]);
            }
            using (new EditorGUI.DisabledScope(this.m_Prewarm.boolValue && this.m_Looping.boolValue))
            {
                ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.startDelay, this.m_StartDelay, new GUILayoutOption[0]);
            }
            ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.lifetime, this.m_LifeTime, new GUILayoutOption[0]);
            ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.speed, this.m_Speed, new GUILayoutOption[0]);
            EditorGUI.BeginChangeCheck();
            bool flag2 = ModuleUI.GUIToggle(InitialModuleUI.s_Texts.size3D, this.m_Size3D, new GUILayoutOption[0]);

            if (EditorGUI.EndChangeCheck())
            {
                if (!flag2)
                {
                    this.m_SizeY.RemoveCurveFromEditor();
                    this.m_SizeZ.RemoveCurveFromEditor();
                }
            }
            if (!this.m_SizeX.stateHasMultipleDifferentValues)
            {
                this.m_SizeZ.SetMinMaxState(this.m_SizeX.state, flag2);
                this.m_SizeY.SetMinMaxState(this.m_SizeX.state, flag2);
            }
            if (flag2)
            {
                this.m_SizeX.m_DisplayName = InitialModuleUI.s_Texts.x;
                base.GUITripleMinMaxCurve(GUIContent.none, InitialModuleUI.s_Texts.x, this.m_SizeX, InitialModuleUI.s_Texts.y, this.m_SizeY, InitialModuleUI.s_Texts.z, this.m_SizeZ, null, new GUILayoutOption[0]);
            }
            else
            {
                this.m_SizeX.m_DisplayName = InitialModuleUI.s_Texts.size;
                ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.size, this.m_SizeX, new GUILayoutOption[0]);
            }
            EditorGUI.BeginChangeCheck();
            bool flag3 = ModuleUI.GUIToggle(InitialModuleUI.s_Texts.rotation3D, this.m_Rotation3D, new GUILayoutOption[0]);

            if (EditorGUI.EndChangeCheck())
            {
                if (!flag3)
                {
                    this.m_RotationX.RemoveCurveFromEditor();
                    this.m_RotationY.RemoveCurveFromEditor();
                }
            }
            if (!this.m_RotationZ.stateHasMultipleDifferentValues)
            {
                this.m_RotationX.SetMinMaxState(this.m_RotationZ.state, flag3);
                this.m_RotationY.SetMinMaxState(this.m_RotationZ.state, flag3);
            }
            if (flag3)
            {
                this.m_RotationZ.m_DisplayName = InitialModuleUI.s_Texts.z;
                base.GUITripleMinMaxCurve(GUIContent.none, InitialModuleUI.s_Texts.x, this.m_RotationX, InitialModuleUI.s_Texts.y, this.m_RotationY, InitialModuleUI.s_Texts.z, this.m_RotationZ, null, new GUILayoutOption[0]);
            }
            else
            {
                this.m_RotationZ.m_DisplayName = InitialModuleUI.s_Texts.rotation;
                ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.rotation, this.m_RotationZ, new GUILayoutOption[0]);
            }
            ModuleUI.GUIFloat(InitialModuleUI.s_Texts.randomizeRotationDirection, this.m_RandomizeRotationDirection, new GUILayoutOption[0]);
            base.GUIMinMaxGradient(InitialModuleUI.s_Texts.color, this.m_Color, false, new GUILayoutOption[0]);
            ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.gravity, this.m_GravityModifier, new GUILayoutOption[0]);
            int num = ModuleUI.GUIPopup(InitialModuleUI.s_Texts.simulationSpace, this.m_SimulationSpace, InitialModuleUI.s_Texts.simulationSpaces, new GUILayoutOption[0]);

            if (num == 2 && this.m_CustomSimulationSpace != null)
            {
                ModuleUI.GUIObject(InitialModuleUI.s_Texts.customSimulationSpace, this.m_CustomSimulationSpace, new GUILayoutOption[0]);
            }
            ModuleUI.GUIFloat(InitialModuleUI.s_Texts.simulationSpeed, this.m_SimulationSpeed, new GUILayoutOption[0]);
            ModuleUI.GUIBoolAsPopup(InitialModuleUI.s_Texts.deltaTime, this.m_UseUnscaledTime, new string[]
            {
                "Scaled",
                "Unscaled"
            }, new GUILayoutOption[0]);
            bool flag4 = this.m_ParticleSystemUI.m_ParticleSystems.FirstOrDefault((ParticleSystem o) => !o.shape.enabled || (o.shape.shapeType != ParticleSystemShapeType.SkinnedMeshRenderer && o.shape.shapeType != ParticleSystemShapeType.MeshRenderer)) != null;

            if (flag4)
            {
                ModuleUI.GUIPopup(InitialModuleUI.s_Texts.scalingMode, this.m_ScalingMode, InitialModuleUI.s_Texts.scalingModes, new GUILayoutOption[0]);
            }
            bool boolValue = this.m_PlayOnAwake.boolValue;
            bool flag5     = ModuleUI.GUIToggle(InitialModuleUI.s_Texts.autoplay, this.m_PlayOnAwake, new GUILayoutOption[0]);

            if (boolValue != flag5)
            {
                this.m_ParticleSystemUI.m_ParticleEffectUI.PlayOnAwakeChanged(flag5);
            }
            ModuleUI.GUIBoolAsPopup(InitialModuleUI.s_Texts.emitterVelocity, this.m_EmitterVelocity, new string[]
            {
                "Transform",
                "Rigidbody"
            }, new GUILayoutOption[0]);
            ModuleUI.GUIInt(InitialModuleUI.s_Texts.maxParticles, this.m_MaxNumParticles, new GUILayoutOption[0]);
            if (!ModuleUI.GUIToggle(InitialModuleUI.s_Texts.autoRandomSeed, this.m_AutoRandomSeed, new GUILayoutOption[0]))
            {
                bool flag6 = this.m_ParticleSystemUI.m_ParticleEffectUI.m_Owner is ParticleSystemInspector;
                if (flag6)
                {
                    GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                    ModuleUI.GUIInt(InitialModuleUI.s_Texts.randomSeed, this.m_RandomSeed, new GUILayoutOption[0]);
                    if (!this.m_ParticleSystemUI.multiEdit && GUILayout.Button("Reseed", EditorStyles.miniButton, new GUILayoutOption[]
                    {
                        GUILayout.Width(60f)
                    }))
                    {
                        this.m_RandomSeed.intValue = this.m_ParticleSystemUI.m_ParticleSystems[0].GenerateRandomSeed();
                    }
                    GUILayout.EndHorizontal();
                }
                else
                {
                    ModuleUI.GUIInt(InitialModuleUI.s_Texts.randomSeed, this.m_RandomSeed, new GUILayoutOption[0]);
                    if (!this.m_ParticleSystemUI.multiEdit && GUILayout.Button("Reseed", EditorStyles.miniButton, new GUILayoutOption[0]))
                    {
                        this.m_RandomSeed.intValue = this.m_ParticleSystemUI.m_ParticleSystems[0].GenerateRandomSeed();
                    }
                }
            }
            ModuleUI.GUIPopup(InitialModuleUI.s_Texts.stopAction, this.m_StopAction, InitialModuleUI.s_Texts.stopActions, new GUILayoutOption[0]);
        }
Пример #11
0
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (s_Texts == null)
            {
                s_Texts = new Texts();
            }
            ModuleUI.GUIFloat(s_Texts.duration, this.m_LengthInSec, "f2");
            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);
            if ((this.m_Looping.boolValue && !boolValue) && (s.time >= this.m_LengthInSec.floatValue))
            {
                s.time = 0f;
            }
            EditorGUI.BeginDisabledGroup(!this.m_Looping.boolValue);
            ModuleUI.GUIToggle(s_Texts.prewarm, this.m_Prewarm);
            EditorGUI.EndDisabledGroup();
            EditorGUI.BeginDisabledGroup(this.m_Prewarm.boolValue && this.m_Looping.boolValue);
            ModuleUI.GUIMinMaxCurve(s_Texts.startDelay, this.m_StartDelay);
            EditorGUI.EndDisabledGroup();
            ModuleUI.GUIMinMaxCurve(s_Texts.lifetime, this.m_LifeTime);
            ModuleUI.GUIMinMaxCurve(s_Texts.speed, this.m_Speed);
            ModuleUI.GUIMinMaxCurve(s_Texts.size, this.m_Size);
            EditorGUI.BeginChangeCheck();
            bool flag2 = ModuleUI.GUIToggle(s_Texts.rotation3D, this.m_Rotation3D);

            if (EditorGUI.EndChangeCheck())
            {
                if (flag2)
                {
                    this.m_RotationZ.RemoveCurveFromEditor();
                }
                else
                {
                    this.m_RotationX.RemoveCurveFromEditor();
                    this.m_RotationY.RemoveCurveFromEditor();
                    this.m_RotationZ.RemoveCurveFromEditor();
                }
            }
            if (flag2)
            {
                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);
            }
            else
            {
                this.m_RotationZ.m_DisplayName = s_Texts.rotation;
                ModuleUI.GUIMinMaxCurve(s_Texts.rotation, this.m_RotationZ);
            }
            ModuleUI.GUIFloat(s_Texts.randomizeRotationDirection, this.m_RandomizeRotationDirection);
            base.GUIMinMaxGradient(s_Texts.color, this.m_Color);
            ModuleUI.GUIFloat(s_Texts.gravity, this.m_GravityModifier);
            ModuleUI.GUIBoolAsPopup(s_Texts.simulationSpace, this.m_SimulationSpace, s_Texts.simulationSpaces);
            string[] options = new string[] { "Hierarchy", "Local", "Shape" };
            ModuleUI.GUIPopup(s_Texts.scalingMode, this.m_ScalingMode, options);
            bool flag3          = this.m_PlayOnAwake.boolValue;
            bool newPlayOnAwake = ModuleUI.GUIToggle(s_Texts.autoplay, this.m_PlayOnAwake);

            if (flag3 != newPlayOnAwake)
            {
                base.m_ParticleSystemUI.m_ParticleEffectUI.PlayOnAwakeChanged(newPlayOnAwake);
            }
            ModuleUI.GUIInt(s_Texts.maxParticles, this.m_MaxNumParticles);
        }
Пример #12
0
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (InitialModuleUI.s_Texts == null)
            {
                InitialModuleUI.s_Texts = new InitialModuleUI.Texts();
            }
            double num1 = (double)ModuleUI.GUIFloat(InitialModuleUI.s_Texts.duration, this.m_LengthInSec, "f2");

            this.m_LengthInSec.floatValue = Mathf.Min(100000f, Mathf.Max(0.0f, this.m_LengthInSec.floatValue));
            bool boolValue1 = this.m_Looping.boolValue;

            ModuleUI.GUIToggle(InitialModuleUI.s_Texts.looping, this.m_Looping);
            if (this.m_Looping.boolValue && !boolValue1 && (double)s.time >= (double)this.m_LengthInSec.floatValue)
            {
                s.time = 0.0f;
            }
            EditorGUI.BeginDisabledGroup(!this.m_Looping.boolValue);
            ModuleUI.GUIToggle(InitialModuleUI.s_Texts.prewarm, this.m_Prewarm);
            EditorGUI.EndDisabledGroup();
            EditorGUI.BeginDisabledGroup(this.m_Prewarm.boolValue && this.m_Looping.boolValue);
            ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.startDelay, this.m_StartDelay);
            EditorGUI.EndDisabledGroup();
            ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.lifetime, this.m_LifeTime);
            ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.speed, this.m_Speed);
            ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.size, this.m_Size);
            EditorGUI.BeginChangeCheck();
            bool flag = ModuleUI.GUIToggle(InitialModuleUI.s_Texts.rotation3D, this.m_Rotation3D);

            if (EditorGUI.EndChangeCheck())
            {
                if (flag)
                {
                    this.m_RotationZ.RemoveCurveFromEditor();
                }
                else
                {
                    this.m_RotationX.RemoveCurveFromEditor();
                    this.m_RotationY.RemoveCurveFromEditor();
                    this.m_RotationZ.RemoveCurveFromEditor();
                }
            }
            if (flag)
            {
                this.m_RotationZ.m_DisplayName = InitialModuleUI.s_Texts.z;
                this.GUITripleMinMaxCurve(GUIContent.none, InitialModuleUI.s_Texts.x, this.m_RotationX, InitialModuleUI.s_Texts.y, this.m_RotationY, InitialModuleUI.s_Texts.z, this.m_RotationZ, (SerializedProperty)null);
            }
            else
            {
                this.m_RotationZ.m_DisplayName = InitialModuleUI.s_Texts.rotation;
                ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.rotation, this.m_RotationZ);
            }
            double num2 = (double)ModuleUI.GUIFloat(InitialModuleUI.s_Texts.randomizeRotationDirection, this.m_RandomizeRotationDirection);

            this.GUIMinMaxGradient(InitialModuleUI.s_Texts.color, this.m_Color);
            double num3 = (double)ModuleUI.GUIFloat(InitialModuleUI.s_Texts.gravity, this.m_GravityModifier);

            ModuleUI.GUIBoolAsPopup(InitialModuleUI.s_Texts.simulationSpace, this.m_SimulationSpace, InitialModuleUI.s_Texts.simulationSpaces);
            ModuleUI.GUIPopup(InitialModuleUI.s_Texts.scalingMode, this.m_ScalingMode, new string[3]
            {
                "Hierarchy",
                "Local",
                "Shape"
            });
            bool boolValue2     = this.m_PlayOnAwake.boolValue;
            bool newPlayOnAwake = ModuleUI.GUIToggle(InitialModuleUI.s_Texts.autoplay, this.m_PlayOnAwake);

            if (boolValue2 != newPlayOnAwake)
            {
                this.m_ParticleSystemUI.m_ParticleEffectUI.PlayOnAwakeChanged(newPlayOnAwake);
            }
            ModuleUI.GUIInt(InitialModuleUI.s_Texts.maxParticles, this.m_MaxNumParticles);
        }
Пример #13
0
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (InitialModuleUI.s_Texts == null)
            {
                InitialModuleUI.s_Texts = new InitialModuleUI.Texts();
            }
            ModuleUI.GUIFloat(InitialModuleUI.s_Texts.duration, this.m_LengthInSec, "f2");
            this.m_LengthInSec.floatValue = Mathf.Min(100000f, Mathf.Max(0f, this.m_LengthInSec.floatValue));
            bool boolValue = this.m_Looping.boolValue;

            ModuleUI.GUIToggle(InitialModuleUI.s_Texts.looping, this.m_Looping);
            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(InitialModuleUI.s_Texts.prewarm, this.m_Prewarm);
            }
            using (new EditorGUI.DisabledScope(this.m_Prewarm.boolValue && this.m_Looping.boolValue))
            {
                ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.startDelay, this.m_StartDelay);
            }
            ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.lifetime, this.m_LifeTime);
            ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.speed, this.m_Speed);
            EditorGUI.BeginChangeCheck();
            bool flag = ModuleUI.GUIToggle(InitialModuleUI.s_Texts.size3D, this.m_Size3D);

            if (EditorGUI.EndChangeCheck())
            {
                if (flag)
                {
                    this.m_SizeX.RemoveCurveFromEditor();
                }
                else
                {
                    this.m_SizeX.RemoveCurveFromEditor();
                    this.m_SizeY.RemoveCurveFromEditor();
                    this.m_SizeZ.RemoveCurveFromEditor();
                }
            }
            if (flag)
            {
                this.m_SizeX.m_DisplayName = InitialModuleUI.s_Texts.x;
                base.GUITripleMinMaxCurve(GUIContent.none, InitialModuleUI.s_Texts.x, this.m_SizeX, InitialModuleUI.s_Texts.y, this.m_SizeY, InitialModuleUI.s_Texts.z, this.m_SizeZ, null);
            }
            else
            {
                this.m_SizeX.m_DisplayName = InitialModuleUI.s_Texts.size;
                ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.size, this.m_SizeX);
            }
            EditorGUI.BeginChangeCheck();
            bool flag2 = ModuleUI.GUIToggle(InitialModuleUI.s_Texts.rotation3D, this.m_Rotation3D);

            if (EditorGUI.EndChangeCheck())
            {
                if (flag2)
                {
                    this.m_RotationZ.RemoveCurveFromEditor();
                }
                else
                {
                    this.m_RotationX.RemoveCurveFromEditor();
                    this.m_RotationY.RemoveCurveFromEditor();
                    this.m_RotationZ.RemoveCurveFromEditor();
                }
            }
            if (flag2)
            {
                this.m_RotationZ.m_DisplayName = InitialModuleUI.s_Texts.z;
                base.GUITripleMinMaxCurve(GUIContent.none, InitialModuleUI.s_Texts.x, this.m_RotationX, InitialModuleUI.s_Texts.y, this.m_RotationY, InitialModuleUI.s_Texts.z, this.m_RotationZ, null);
            }
            else
            {
                this.m_RotationZ.m_DisplayName = InitialModuleUI.s_Texts.rotation;
                ModuleUI.GUIMinMaxCurve(InitialModuleUI.s_Texts.rotation, this.m_RotationZ);
            }
            ModuleUI.GUIFloat(InitialModuleUI.s_Texts.randomizeRotationDirection, this.m_RandomizeRotationDirection);
            base.GUIMinMaxGradient(InitialModuleUI.s_Texts.color, this.m_Color);
            ModuleUI.GUIFloat(InitialModuleUI.s_Texts.gravity, this.m_GravityModifier);
            ModuleUI.GUIBoolAsPopup(InitialModuleUI.s_Texts.simulationSpace, this.m_SimulationSpace, InitialModuleUI.s_Texts.simulationSpaces);
            ModuleUI.GUIPopup(InitialModuleUI.s_Texts.scalingMode, this.m_ScalingMode, new string[]
            {
                "Hierarchy",
                "Local",
                "Shape"
            });
            bool boolValue2 = this.m_PlayOnAwake.boolValue;
            bool flag3      = ModuleUI.GUIToggle(InitialModuleUI.s_Texts.autoplay, this.m_PlayOnAwake);

            if (boolValue2 != flag3)
            {
                this.m_ParticleSystemUI.m_ParticleEffectUI.PlayOnAwakeChanged(flag3);
            }
            ModuleUI.GUIInt(InitialModuleUI.s_Texts.maxParticles, this.m_MaxNumParticles);
            if (!ModuleUI.GUIToggle(InitialModuleUI.s_Texts.autoRandomSeed, this.m_AutoRandomSeed))
            {
                bool flag4 = this.m_ParticleSystemUI.m_ParticleEffectUI.m_Owner is ParticleSystemInspector;
                if (flag4)
                {
                    GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                    ModuleUI.GUIInt(InitialModuleUI.s_Texts.randomSeed, this.m_RandomSeed);
                    if (GUILayout.Button("Reseed", EditorStyles.miniButton, new GUILayoutOption[]
                    {
                        GUILayout.Width(60f)
                    }))
                    {
                        this.m_RandomSeed.intValue = this.m_ParticleSystemUI.m_ParticleSystem.GenerateRandomSeed();
                    }
                    GUILayout.EndHorizontal();
                }
                else
                {
                    ModuleUI.GUIInt(InitialModuleUI.s_Texts.randomSeed, this.m_RandomSeed);
                    if (GUILayout.Button("Reseed", EditorStyles.miniButton, new GUILayoutOption[0]))
                    {
                        this.m_RandomSeed.intValue = this.m_ParticleSystemUI.m_ParticleSystem.GenerateRandomSeed();
                    }
                }
            }
        }