GUIFloat() public static méthode

public static GUIFloat ( GUIContent guiContent, UnityEditor.SerializedProperty floatProp ) : float
guiContent UnityEngine.GUIContent
floatProp UnityEditor.SerializedProperty
Résultat float
        public override void OnInspectorGUI(InitialModuleUI initial)
        {
            EditorGUI.showMixedValue = this.m_Type.hasMultipleDifferentValues;
            int num  = this.m_Type.intValue;
            int num2 = this.m_TypeToGuiTypeIndex[num];

            EditorGUI.BeginChangeCheck();
            int  num3 = ModuleUI.GUIPopup(ShapeModuleUI.s_Texts.shape, num2, ShapeModuleUI.s_Texts.shapeTypes, this.m_Type, new GUILayoutOption[0]);
            bool flag = EditorGUI.EndChangeCheck();

            EditorGUI.showMixedValue = false;
            ParticleSystemShapeType particleSystemShapeType = this.m_GuiTypes[num3];

            if (num3 != num2)
            {
                num = (int)particleSystemShapeType;
            }
            if (!this.m_Type.hasMultipleDifferentValues)
            {
                switch (particleSystemShapeType)
                {
                case ParticleSystemShapeType.Sphere:
                case ParticleSystemShapeType.Hemisphere:
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius.m_Value, new GUILayoutOption[0]);
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radiusThickness, this.m_RadiusThickness, new GUILayoutOption[0]);
                    break;

                case ParticleSystemShapeType.Cone:
                {
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.coneAngle, this.m_Angle, new GUILayoutOption[0]);
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius.m_Value, new GUILayoutOption[0]);
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radiusThickness, this.m_RadiusThickness, new GUILayoutOption[0]);
                    this.m_Arc.OnInspectorGUI(ShapeModuleUI.s_ArcTexts);
                    bool disabled = num != 8;
                    using (new EditorGUI.DisabledScope(disabled))
                    {
                        ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.coneLength, this.m_Length, new GUILayoutOption[0]);
                    }
                    int num4 = this.ConvertConeTypeToConeEmitFrom((ParticleSystemShapeType)num);
                    num4 = ModuleUI.GUIPopup(ShapeModuleUI.s_Texts.emitFrom, num4, ShapeModuleUI.s_Texts.coneTypes, this.m_Type, new GUILayoutOption[0]);
                    num  = (int)this.ConvertConeEmitFromToConeType(num4);
                    break;
                }

                case ParticleSystemShapeType.Box:
                {
                    int num5 = this.ConvertBoxTypeToBoxEmitFrom((ParticleSystemShapeType)num);
                    num5 = ModuleUI.GUIPopup(ShapeModuleUI.s_Texts.emitFrom, num5, ShapeModuleUI.s_Texts.boxTypes, this.m_Type, new GUILayoutOption[0]);
                    num  = (int)this.ConvertBoxEmitFromToBoxType(num5);
                    if (num == 15 || num == 16)
                    {
                        ModuleUI.GUIVector3Field(ShapeModuleUI.s_Texts.boxThickness, this.m_BoxThickness, new GUILayoutOption[0]);
                    }
                    break;
                }

                case ParticleSystemShapeType.Mesh:
                case ParticleSystemShapeType.MeshRenderer:
                case ParticleSystemShapeType.SkinnedMeshRenderer:
                {
                    ModuleUI.GUIPopup(ShapeModuleUI.s_Texts.meshType, this.m_PlacementMode, ShapeModuleUI.s_Texts.meshTypes, new GUILayoutOption[0]);
                    Material material = null;
                    Mesh     mesh     = null;
                    if (particleSystemShapeType == ParticleSystemShapeType.Mesh)
                    {
                        ModuleUI.GUIObject(ShapeModuleUI.s_Texts.mesh, this.m_Mesh, new GUILayoutOption[0]);
                        mesh = (Mesh)this.m_Mesh.objectReferenceValue;
                    }
                    else if (particleSystemShapeType == ParticleSystemShapeType.MeshRenderer)
                    {
                        ModuleUI.GUIObject(ShapeModuleUI.s_Texts.meshRenderer, this.m_MeshRenderer, new GUILayoutOption[0]);
                        MeshRenderer meshRenderer = (MeshRenderer)this.m_MeshRenderer.objectReferenceValue;
                        if (meshRenderer)
                        {
                            material = meshRenderer.sharedMaterial;
                            if (meshRenderer.GetComponent <MeshFilter>())
                            {
                                mesh = meshRenderer.GetComponent <MeshFilter>().sharedMesh;
                            }
                        }
                    }
                    else
                    {
                        ModuleUI.GUIObject(ShapeModuleUI.s_Texts.skinnedMeshRenderer, this.m_SkinnedMeshRenderer, new GUILayoutOption[0]);
                        SkinnedMeshRenderer skinnedMeshRenderer = (SkinnedMeshRenderer)this.m_SkinnedMeshRenderer.objectReferenceValue;
                        if (skinnedMeshRenderer)
                        {
                            material = skinnedMeshRenderer.sharedMaterial;
                            mesh     = skinnedMeshRenderer.sharedMesh;
                        }
                    }
                    ModuleUI.GUIToggleWithIntField(ShapeModuleUI.s_Texts.meshMaterialIndex, this.m_UseMeshMaterialIndex, this.m_MeshMaterialIndex, false, new GUILayoutOption[0]);
                    bool flag2 = ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.useMeshColors, this.m_UseMeshColors, new GUILayoutOption[0]);
                    if (flag2)
                    {
                        if (material != null && mesh != null)
                        {
                            int name  = Shader.PropertyToID("_Color");
                            int name2 = Shader.PropertyToID("_TintColor");
                            if (!material.HasProperty(name) && !material.HasProperty(name2) && !mesh.HasChannel(Mesh.InternalShaderChannel.Color))
                            {
                                GUIContent gUIContent = EditorGUIUtility.TrTextContent("To use mesh colors, your source mesh must either provide vertex colors, or its shader must contain a color property named \"_Color\" or \"_TintColor\".", null, null);
                                EditorGUILayout.HelpBox(gUIContent.text, MessageType.Warning, true);
                            }
                        }
                    }
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.meshNormalOffset, this.m_MeshNormalOffset, new GUILayoutOption[0]);
                    break;
                }

                case ParticleSystemShapeType.Circle:
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius.m_Value, new GUILayoutOption[0]);
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radiusThickness, this.m_RadiusThickness, new GUILayoutOption[0]);
                    this.m_Arc.OnInspectorGUI(ShapeModuleUI.s_ArcTexts);
                    break;

                case ParticleSystemShapeType.SingleSidedEdge:
                    this.m_Radius.OnInspectorGUI(ShapeModuleUI.s_RadiusTexts);
                    break;

                case ParticleSystemShapeType.Donut:
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius.m_Value, new GUILayoutOption[0]);
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.donutRadius, this.m_DonutRadius, new GUILayoutOption[0]);
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radiusThickness, this.m_RadiusThickness, new GUILayoutOption[0]);
                    this.m_Arc.OnInspectorGUI(ShapeModuleUI.s_ArcTexts);
                    break;
                }
            }
            if (flag || !this.m_Type.hasMultipleDifferentValues)
            {
                this.m_Type.intValue = num;
            }
            this.OnTextureInspectorGUI();
            this.OnTransformInspectorGUI();
            this.OnMiscInspectorGUI();
        }
Exemple #2
0
 public override void OnInspectorGUI(ParticleSystem s)
 {
     if (RendererModuleUI.s_Texts == null)
     {
         RendererModuleUI.s_Texts = new RendererModuleUI.Texts();
     }
     RendererModuleUI.RenderMode intValue   = (RendererModuleUI.RenderMode) this.m_RenderMode.intValue;
     RendererModuleUI.RenderMode renderMode = (RendererModuleUI.RenderMode)ModuleUI.GUIPopup(RendererModuleUI.s_Texts.renderMode, this.m_RenderMode, RendererModuleUI.s_Texts.particleTypes, new GUILayoutOption[0]);
     if (renderMode == RendererModuleUI.RenderMode.Mesh)
     {
         EditorGUI.indentLevel++;
         this.DoListOfMeshesGUI();
         EditorGUI.indentLevel--;
         if (intValue != RendererModuleUI.RenderMode.Mesh && this.m_Meshes[0].objectReferenceInstanceIDValue == 0)
         {
             this.m_Meshes[0].objectReferenceValue = Resources.GetBuiltinResource(typeof(Mesh), "Cube.fbx");
         }
     }
     else if (renderMode == RendererModuleUI.RenderMode.Stretch3D)
     {
         EditorGUI.indentLevel++;
         ModuleUI.GUIFloat(RendererModuleUI.s_Texts.cameraSpeedScale, this.m_CameraVelocityScale, new GUILayoutOption[0]);
         ModuleUI.GUIFloat(RendererModuleUI.s_Texts.speedScale, this.m_VelocityScale, new GUILayoutOption[0]);
         ModuleUI.GUIFloat(RendererModuleUI.s_Texts.lengthScale, this.m_LengthScale, new GUILayoutOption[0]);
         EditorGUI.indentLevel--;
     }
     if (renderMode != RendererModuleUI.RenderMode.None)
     {
         if (renderMode != RendererModuleUI.RenderMode.Mesh)
         {
             ModuleUI.GUIFloat(RendererModuleUI.s_Texts.normalDirection, this.m_NormalDirection, new GUILayoutOption[0]);
         }
         if (this.m_Material != null)
         {
             ModuleUI.GUIObject(RendererModuleUI.s_Texts.material, this.m_Material, new GUILayoutOption[0]);
         }
     }
     if (this.m_ParticleSystemUI.m_ParticleSystem.trails.enabled && this.m_TrailMaterial != null)
     {
         ModuleUI.GUIObject(RendererModuleUI.s_Texts.trailMaterial, this.m_TrailMaterial, new GUILayoutOption[0]);
     }
     if (renderMode != RendererModuleUI.RenderMode.None)
     {
         ModuleUI.GUIPopup(RendererModuleUI.s_Texts.sortMode, this.m_SortMode, RendererModuleUI.s_Texts.sortTypes, new GUILayoutOption[0]);
         ModuleUI.GUIFloat(RendererModuleUI.s_Texts.sortingFudge, this.m_SortingFudge, new GUILayoutOption[0]);
         if (renderMode != RendererModuleUI.RenderMode.Mesh)
         {
             ModuleUI.GUIFloat(RendererModuleUI.s_Texts.minParticleSize, this.m_MinParticleSize, new GUILayoutOption[0]);
             ModuleUI.GUIFloat(RendererModuleUI.s_Texts.maxParticleSize, this.m_MaxParticleSize, new GUILayoutOption[0]);
         }
         if (renderMode == RendererModuleUI.RenderMode.Billboard)
         {
             if (this.m_ParticleSystemUI.m_ParticleSystem.shape.alignToDirection)
             {
                 using (new EditorGUI.DisabledScope(true))
                 {
                     ModuleUI.GUIPopup(RendererModuleUI.s_Texts.space, 0, new string[]
                     {
                         RendererModuleUI.s_Texts.spaces[2]
                     }, new GUILayoutOption[0]);
                 }
                 GUIContent gUIContent = EditorGUIUtility.TextContent("Using Align to Direction in the Shape Module forces the system to be rendered using Local Billboard Alignment.");
                 EditorGUILayout.HelpBox(gUIContent.text, MessageType.Info, true);
             }
             else
             {
                 ModuleUI.GUIPopup(RendererModuleUI.s_Texts.space, this.m_RenderAlignment, RendererModuleUI.s_Texts.spaces, new GUILayoutOption[0]);
             }
         }
         ModuleUI.GUIVector3Field(RendererModuleUI.s_Texts.pivot, this.m_Pivot, new GUILayoutOption[0]);
         EditorGUI.BeginChangeCheck();
         RendererModuleUI.s_VisualizePivot = ModuleUI.GUIToggle(RendererModuleUI.s_Texts.visualizePivot, RendererModuleUI.s_VisualizePivot, new GUILayoutOption[0]);
         if (EditorGUI.EndChangeCheck())
         {
             EditorPrefs.SetBool("VisualizePivot", RendererModuleUI.s_VisualizePivot);
         }
         if (ModuleUI.GUIToggle(RendererModuleUI.s_Texts.useCustomVertexStreams, this.m_UseCustomVertexStreams, new GUILayoutOption[0]))
         {
             this.DoVertexStreamsGUI(renderMode);
         }
         EditorGUILayout.Space();
         ModuleUI.GUIPopup(RendererModuleUI.s_Texts.castShadows, this.m_CastShadows, this.m_CastShadows.enumDisplayNames, new GUILayoutOption[0]);
         using (new EditorGUI.DisabledScope(SceneView.IsUsingDeferredRenderingPath()))
         {
             ModuleUI.GUIToggle(RendererModuleUI.s_Texts.receiveShadows, this.m_ReceiveShadows, new GUILayoutOption[0]);
         }
         EditorGUILayout.SortingLayerField(RendererModuleUI.s_Texts.sortingLayer, this.m_SortingLayerID, ParticleSystemStyles.Get().popup, ParticleSystemStyles.Get().label);
         ModuleUI.GUIInt(RendererModuleUI.s_Texts.sortingOrder, this.m_SortingOrder, new GUILayoutOption[0]);
     }
     this.m_Probes.OnGUI(null, s.GetComponent <Renderer>(), true);
 }
Exemple #3
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]);
        }
Exemple #4
0
 public static float GUIFloat(string label, SerializedProperty floatProp)
 {
     return(ModuleUI.GUIFloat(GUIContent.Temp(label), floatProp));
 }
Exemple #5
0
        public override void OnInspectorGUI(InitialModuleUI initial)
        {
            if (UVModuleUI.s_Texts == null)
            {
                UVModuleUI.s_Texts = new UVModuleUI.Texts();
            }
            int num = ModuleUI.GUIPopup(UVModuleUI.s_Texts.mode, this.m_Mode, UVModuleUI.s_Texts.modes, new GUILayoutOption[0]);

            if (!this.m_Mode.hasMultipleDifferentValues)
            {
                if (num == 0)
                {
                    ModuleUI.GUIIntDraggableX2(UVModuleUI.s_Texts.tiles, UVModuleUI.s_Texts.tilesX, this.m_TilesX, UVModuleUI.s_Texts.tilesY, this.m_TilesY, new GUILayoutOption[0]);
                    int num2 = ModuleUI.GUIPopup(UVModuleUI.s_Texts.animation, this.m_AnimationType, UVModuleUI.s_Texts.types, new GUILayoutOption[0]);
                    if (num2 == 1)
                    {
                        ModuleUI.GUIToggle(UVModuleUI.s_Texts.randomRow, this.m_RandomRow, new GUILayoutOption[0]);
                        if (!this.m_RandomRow.boolValue)
                        {
                            ModuleUI.GUIInt(UVModuleUI.s_Texts.row, this.m_RowIndex, new GUILayoutOption[0]);
                        }
                        this.m_FrameOverTime.m_RemapValue = (float)this.m_TilesX.intValue;
                        this.m_StartFrame.m_RemapValue    = (float)this.m_TilesX.intValue;
                    }
                    else
                    {
                        this.m_FrameOverTime.m_RemapValue = (float)(this.m_TilesX.intValue * this.m_TilesY.intValue);
                        this.m_StartFrame.m_RemapValue    = (float)(this.m_TilesX.intValue * this.m_TilesY.intValue);
                    }
                }
                else
                {
                    this.DoListOfSpritesGUI();
                    this.ValidateSpriteList();
                    this.m_FrameOverTime.m_RemapValue = (float)this.m_Sprites.arraySize;
                    this.m_StartFrame.m_RemapValue    = (float)this.m_Sprites.arraySize;
                }
                ModuleUI.GUIMinMaxCurve(UVModuleUI.s_Texts.frameOverTime, this.m_FrameOverTime, new GUILayoutOption[0]);
                ModuleUI.GUIMinMaxCurve(UVModuleUI.s_Texts.startFrame, this.m_StartFrame, new GUILayoutOption[0]);
            }
            ModuleUI.GUIFloat(UVModuleUI.s_Texts.cycles, this.m_Cycles, new GUILayoutOption[0]);
            bool disabled = false;

            ParticleSystem[] particleSystems = this.m_ParticleSystemUI.m_ParticleSystems;
            for (int i = 0; i < particleSystems.Length; i++)
            {
                ParticleSystem         particleSystem = particleSystems[i];
                ParticleSystemRenderer component      = particleSystem.GetComponent <ParticleSystemRenderer>();
                if (component != null && component.renderMode == ParticleSystemRenderMode.Mesh)
                {
                    disabled = true;
                    break;
                }
            }
            using (new EditorGUI.DisabledScope(disabled))
            {
                ModuleUI.GUIFloat(UVModuleUI.s_Texts.flipU, this.m_FlipU, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(UVModuleUI.s_Texts.flipV, this.m_FlipV, new GUILayoutOption[0]);
            }
            this.m_UVChannelMask.intValue = (int)((UVChannelFlags)ModuleUI.GUIEnumMask(UVModuleUI.s_Texts.uvChannelMask, (UVChannelFlags)this.m_UVChannelMask.intValue, new GUILayoutOption[0]));
        }
        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();
                    }
                }
            }
        }
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (ShapeModuleUI.s_Texts == null)
            {
                ShapeModuleUI.s_Texts = new ShapeModuleUI.Texts();
            }
            int  num       = this.m_Type.intValue;
            int  num2      = this.m_TypeToGuiTypeIndex[num];
            bool usesShell = this.GetUsesShell((ShapeModuleUI.ShapeTypes)num);
            int  num3      = ModuleUI.GUIPopup(ShapeModuleUI.s_Texts.shape, num2, this.m_GuiNames, new GUILayoutOption[0]);

            ShapeModuleUI.ShapeTypes shapeTypes = this.m_GuiTypes[num3];
            if (num3 != num2)
            {
                num = (int)shapeTypes;
            }
            switch (shapeTypes)
            {
            case ShapeModuleUI.ShapeTypes.Sphere:
            {
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius, new GUILayoutOption[0]);
                bool flag = ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.emitFromShell, usesShell, new GUILayoutOption[0]);
                num = ((!flag) ? 0 : 1);
                break;
            }

            case ShapeModuleUI.ShapeTypes.Hemisphere:
            {
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius, new GUILayoutOption[0]);
                bool flag2 = ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.emitFromShell, usesShell, new GUILayoutOption[0]);
                num = ((!flag2) ? 2 : 3);
                break;
            }

            case ShapeModuleUI.ShapeTypes.Cone:
            {
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.coneAngle, this.m_Angle, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius, new GUILayoutOption[0]);
                bool disabled = num != 8 && num != 9;
                using (new EditorGUI.DisabledScope(disabled))
                {
                    ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.coneLength, this.m_Length, new GUILayoutOption[0]);
                }
                string[] options = new string[]
                {
                    "Base",
                    "Base Shell",
                    "Volume",
                    "Volume Shell"
                };
                int num4 = this.ConvertConeTypeToConeEmitFrom((ShapeModuleUI.ShapeTypes)num);
                num4 = ModuleUI.GUIPopup(ShapeModuleUI.s_Texts.emitFrom, num4, options, new GUILayoutOption[0]);
                num  = (int)this.ConvertConeEmitFromToConeType(num4);
                break;
            }

            case ShapeModuleUI.ShapeTypes.Box:
            {
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.boxX, this.m_BoxX, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.boxY, this.m_BoxY, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.boxZ, this.m_BoxZ, new GUILayoutOption[0]);
                string[] options2 = new string[]
                {
                    "Volume",
                    "Shell",
                    "Edge"
                };
                int num5 = this.ConvertBoxTypeToConeEmitFrom((ShapeModuleUI.ShapeTypes)num);
                num5 = ModuleUI.GUIPopup(ShapeModuleUI.s_Texts.emitFrom, num5, options2, new GUILayoutOption[0]);
                num  = (int)this.ConvertBoxEmitFromToConeType(num5);
                break;
            }

            case ShapeModuleUI.ShapeTypes.Mesh:
            case ShapeModuleUI.ShapeTypes.MeshRenderer:
            case ShapeModuleUI.ShapeTypes.SkinnedMeshRenderer:
            {
                string[] options3 = new string[]
                {
                    "Vertex",
                    "Edge",
                    "Triangle"
                };
                ModuleUI.GUIPopup("", this.m_PlacementMode, options3, new GUILayoutOption[0]);
                Material material = null;
                Mesh     mesh     = null;
                if (shapeTypes == ShapeModuleUI.ShapeTypes.Mesh)
                {
                    ModuleUI.GUIObject(ShapeModuleUI.s_Texts.mesh, this.m_Mesh, new GUILayoutOption[0]);
                }
                else if (shapeTypes == ShapeModuleUI.ShapeTypes.MeshRenderer)
                {
                    ModuleUI.GUIObject(ShapeModuleUI.s_Texts.meshRenderer, this.m_MeshRenderer, new GUILayoutOption[0]);
                    MeshRenderer meshRenderer = (MeshRenderer)this.m_MeshRenderer.objectReferenceValue;
                    if (meshRenderer)
                    {
                        material = meshRenderer.sharedMaterial;
                        if (meshRenderer.GetComponent <MeshFilter>())
                        {
                            mesh = meshRenderer.GetComponent <MeshFilter>().sharedMesh;
                        }
                    }
                }
                else
                {
                    ModuleUI.GUIObject(ShapeModuleUI.s_Texts.skinnedMeshRenderer, this.m_SkinnedMeshRenderer, new GUILayoutOption[0]);
                    SkinnedMeshRenderer skinnedMeshRenderer = (SkinnedMeshRenderer)this.m_SkinnedMeshRenderer.objectReferenceValue;
                    if (skinnedMeshRenderer)
                    {
                        material = skinnedMeshRenderer.sharedMaterial;
                        mesh     = skinnedMeshRenderer.sharedMesh;
                    }
                }
                ModuleUI.GUIToggleWithIntField(ShapeModuleUI.s_Texts.meshMaterialIndex, this.m_UseMeshMaterialIndex, this.m_MeshMaterialIndex, false, new GUILayoutOption[0]);
                bool flag3 = ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.useMeshColors, this.m_UseMeshColors, new GUILayoutOption[0]);
                if (flag3)
                {
                    if (material != null && mesh != null)
                    {
                        int nameID  = Shader.PropertyToID("_Color");
                        int nameID2 = Shader.PropertyToID("_TintColor");
                        if (!material.HasProperty(nameID) && !material.HasProperty(nameID2) && !mesh.HasChannel(Mesh.InternalShaderChannel.Color))
                        {
                            GUIContent gUIContent = EditorGUIUtility.TextContent("To use mesh colors, your source mesh must either provide vertex colors, or its shader must contain a color property named \"_Color\" or \"_TintColor\".");
                            EditorGUILayout.HelpBox(gUIContent.text, MessageType.Warning, true);
                        }
                    }
                }
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.meshNormalOffset, this.m_MeshNormalOffset, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.meshScale, this.m_MeshScale, new GUILayoutOption[0]);
                break;
            }

            case ShapeModuleUI.ShapeTypes.Circle:
            {
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.arc, this.m_Arc, new GUILayoutOption[0]);
                bool flag4 = ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.emitFromEdge, usesShell, new GUILayoutOption[0]);
                num = ((!flag4) ? 10 : 11);
                break;
            }

            case ShapeModuleUI.ShapeTypes.SingleSidedEdge:
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius, new GUILayoutOption[0]);
                break;
            }
            this.m_Type.intValue = num;
            ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.alignToDirection, this.m_AlignToDirection, new GUILayoutOption[0]);
            ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.randomDirectionAmount, this.m_RandomDirectionAmount, new GUILayoutOption[0]);
            ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.sphericalDirectionAmount, this.m_SphericalDirectionAmount, new GUILayoutOption[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);
        }
Exemple #9
0
 public static float GUIFloat(string label, SerializedProperty floatProp, params GUILayoutOption[] layoutOptions)
 {
     return(ModuleUI.GUIFloat(GUIContent.Temp(label), floatProp, layoutOptions));
 }
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (ShapeModuleUI.s_Texts == null)
            {
                ShapeModuleUI.s_Texts = new ShapeModuleUI.Texts();
            }
            int  index1    = this.m_Type.intValue;
            int  intValue  = this.m_TypeToGuiTypeIndex[index1];
            bool usesShell = this.GetUsesShell((ShapeModuleUI.ShapeTypes)index1);
            int  index2    = ModuleUI.GUIPopup(ShapeModuleUI.s_Texts.shape, intValue, this.m_GuiNames);

            ShapeModuleUI.ShapeTypes guiType = this.m_GuiTypes[index2];
            if (index2 != intValue)
            {
                index1 = (int)guiType;
            }
            switch (guiType)
            {
            case ShapeModuleUI.ShapeTypes.Sphere:
                double num1 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius);
                index1 = !ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.emitFromShell, usesShell) ? 0 : 1;
                break;

            case ShapeModuleUI.ShapeTypes.Hemisphere:
                double num2 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius);
                index1 = !ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.emitFromShell, usesShell) ? 2 : 3;
                break;

            case ShapeModuleUI.ShapeTypes.Cone:
                double num3 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.coneAngle, this.m_Angle);
                double num4 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius);
                EditorGUI.BeginDisabledGroup((index1 == 8 ? 1 : (index1 == 9 ? 1 : 0)) == 0);
                double num5 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.coneLength, this.m_Length);
                EditorGUI.EndDisabledGroup();
                string[] options1 = new string[4] {
                    "Base", "Base Shell", "Volume", "Volume Shell"
                };
                int coneEmitFrom = this.ConvertConeTypeToConeEmitFrom((ShapeModuleUI.ShapeTypes)index1);
                index1 = (int)this.ConvertConeEmitFromToConeType(ModuleUI.GUIPopup(ShapeModuleUI.s_Texts.emitFrom, coneEmitFrom, options1));
                break;

            case ShapeModuleUI.ShapeTypes.Box:
                double num6 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.boxX, this.m_BoxX);
                double num7 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.boxY, this.m_BoxY);
                double num8 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.boxZ, this.m_BoxZ);
                break;

            case ShapeModuleUI.ShapeTypes.Mesh:
            case ShapeModuleUI.ShapeTypes.MeshRenderer:
            case ShapeModuleUI.ShapeTypes.SkinnedMeshRenderer:
                string[] options2 = new string[3] {
                    "Vertex", "Edge", "Triangle"
                };
                ModuleUI.GUIPopup(string.Empty, this.m_PlacementMode, options2);
                if (guiType == ShapeModuleUI.ShapeTypes.Mesh)
                {
                    ModuleUI.GUIObject(ShapeModuleUI.s_Texts.mesh, this.m_Mesh);
                }
                else if (guiType == ShapeModuleUI.ShapeTypes.MeshRenderer)
                {
                    ModuleUI.GUIObject(ShapeModuleUI.s_Texts.meshRenderer, this.m_MeshRenderer);
                }
                else
                {
                    ModuleUI.GUIObject(ShapeModuleUI.s_Texts.skinnedMeshRenderer, this.m_SkinnedMeshRenderer);
                }
                ModuleUI.GUIToggleWithIntField(ShapeModuleUI.s_Texts.meshMaterialIndex, this.m_UseMeshMaterialIndex, this.m_MeshMaterialIndex, false);
                ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.useMeshColors, this.m_UseMeshColors);
                double num9 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.meshNormalOffset, this.m_MeshNormalOffset);
                break;

            case ShapeModuleUI.ShapeTypes.Circle:
                double num10 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius);
                double num11 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.arc, this.m_Arc);
                index1 = !ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.emitFromEdge, usesShell) ? 10 : 11;
                break;

            case ShapeModuleUI.ShapeTypes.SingleSidedEdge:
                double num12 = (double)ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius);
                break;
            }
            this.m_Type.intValue = index1;
            ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.randomDirection, this.m_RandomDirection);
        }
        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);
        }
        public override void OnInspectorGUI(ParticleSystem s)
        {
            Material sharedMaterial;
            Mesh     sharedMesh;

            if (s_Texts == null)
            {
                s_Texts = new Texts();
            }
            int        intValue  = this.m_Type.intValue;
            int        num2      = this.m_TypeToGuiTypeIndex[intValue];
            bool       usesShell = this.GetUsesShell((ShapeTypes)intValue);
            int        index     = ModuleUI.GUIPopup(s_Texts.shape, num2, this.m_GuiNames, new GUILayoutOption[0]);
            ShapeTypes types     = this.m_GuiTypes[index];

            if (index != num2)
            {
                intValue = (int)types;
            }
            switch (types)
            {
            case ShapeTypes.Sphere:
                ModuleUI.GUIFloat(s_Texts.radius, this.m_Radius, new GUILayoutOption[0]);
                intValue = !ModuleUI.GUIToggle(s_Texts.emitFromShell, usesShell, new GUILayoutOption[0]) ? 0 : 1;
                goto Label_0581;

            case ShapeTypes.Hemisphere:
                ModuleUI.GUIFloat(s_Texts.radius, this.m_Radius, new GUILayoutOption[0]);
                intValue = !ModuleUI.GUIToggle(s_Texts.emitFromShell, usesShell, new GUILayoutOption[0]) ? 2 : 3;
                goto Label_0581;

            case ShapeTypes.Cone:
            {
                ModuleUI.GUIFloat(s_Texts.coneAngle, this.m_Angle, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(s_Texts.radius, this.m_Radius, new GUILayoutOption[0]);
                bool disabled = (intValue != 8) && (intValue != 9);
                using (new EditorGUI.DisabledScope(disabled))
                {
                    ModuleUI.GUIFloat(s_Texts.coneLength, this.m_Length, new GUILayoutOption[0]);
                }
                string[] options = new string[] { "Base", "Base Shell", "Volume", "Volume Shell" };
                int      num5    = this.ConvertConeTypeToConeEmitFrom((ShapeTypes)intValue);
                num5     = ModuleUI.GUIPopup(s_Texts.emitFrom, num5, options, new GUILayoutOption[0]);
                intValue = (int)this.ConvertConeEmitFromToConeType(num5);
                goto Label_0581;
            }

            case ShapeTypes.Box:
            {
                ModuleUI.GUIFloat(s_Texts.boxX, this.m_BoxX, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(s_Texts.boxY, this.m_BoxY, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(s_Texts.boxZ, this.m_BoxZ, new GUILayoutOption[0]);
                string[] strArray = new string[] { "Volume", "Shell", "Edge" };
                int      num4     = this.ConvertBoxTypeToConeEmitFrom((ShapeTypes)intValue);
                num4     = ModuleUI.GUIPopup(s_Texts.emitFrom, num4, strArray, new GUILayoutOption[0]);
                intValue = (int)this.ConvertBoxEmitFromToConeType(num4);
                goto Label_0581;
            }

            case ShapeTypes.Mesh:
            case ShapeTypes.MeshRenderer:
            case ShapeTypes.SkinnedMeshRenderer:
            {
                string[] strArray3 = new string[] { "Vertex", "Edge", "Triangle" };
                ModuleUI.GUIPopup("", this.m_PlacementMode, strArray3, new GUILayoutOption[0]);
                sharedMaterial = null;
                sharedMesh     = null;
                if (types != ShapeTypes.Mesh)
                {
                    if (types == ShapeTypes.MeshRenderer)
                    {
                        ModuleUI.GUIObject(s_Texts.meshRenderer, this.m_MeshRenderer, new GUILayoutOption[0]);
                        MeshRenderer objectReferenceValue = (MeshRenderer)this.m_MeshRenderer.objectReferenceValue;
                        if (objectReferenceValue != null)
                        {
                            sharedMaterial = objectReferenceValue.sharedMaterial;
                            if (objectReferenceValue.GetComponent <MeshFilter>() != null)
                            {
                                sharedMesh = objectReferenceValue.GetComponent <MeshFilter>().sharedMesh;
                            }
                        }
                    }
                    else
                    {
                        ModuleUI.GUIObject(s_Texts.skinnedMeshRenderer, this.m_SkinnedMeshRenderer, new GUILayoutOption[0]);
                        SkinnedMeshRenderer renderer2 = (SkinnedMeshRenderer)this.m_SkinnedMeshRenderer.objectReferenceValue;
                        if (renderer2 != null)
                        {
                            sharedMaterial = renderer2.sharedMaterial;
                            sharedMesh     = renderer2.sharedMesh;
                        }
                    }
                    break;
                }
                ModuleUI.GUIObject(s_Texts.mesh, this.m_Mesh, new GUILayoutOption[0]);
                break;
            }

            case ShapeTypes.Circle:
                ModuleUI.GUIFloat(s_Texts.radius, this.m_Radius, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(s_Texts.arc, this.m_Arc, new GUILayoutOption[0]);
                intValue = !ModuleUI.GUIToggle(s_Texts.emitFromEdge, usesShell, new GUILayoutOption[0]) ? 10 : 11;
                goto Label_0581;

            case ShapeTypes.SingleSidedEdge:
                ModuleUI.GUIFloat(s_Texts.radius, this.m_Radius, new GUILayoutOption[0]);
                goto Label_0581;

            default:
                goto Label_0581;
            }
            ModuleUI.GUIToggleWithIntField(s_Texts.meshMaterialIndex, this.m_UseMeshMaterialIndex, this.m_MeshMaterialIndex, false, new GUILayoutOption[0]);
            if (ModuleUI.GUIToggle(s_Texts.useMeshColors, this.m_UseMeshColors, new GUILayoutOption[0]) && ((sharedMaterial != null) && (sharedMesh != null)))
            {
                int nameID = Shader.PropertyToID("_Color");
                int num7   = Shader.PropertyToID("_TintColor");
                if ((!sharedMaterial.HasProperty(nameID) && !sharedMaterial.HasProperty(num7)) && !sharedMesh.HasChannel(Mesh.InternalShaderChannel.Color))
                {
                    EditorGUILayout.HelpBox(EditorGUIUtility.TextContent("To use mesh colors, your source mesh must either provide vertex colors, or its shader must contain a color property named \"_Color\" or \"_TintColor\".").text, MessageType.Warning, true);
                }
            }
            ModuleUI.GUIFloat(s_Texts.meshNormalOffset, this.m_MeshNormalOffset, new GUILayoutOption[0]);
            ModuleUI.GUIFloat(s_Texts.meshScale, this.m_MeshScale, new GUILayoutOption[0]);
Label_0581:
            this.m_Type.intValue = intValue;
            ModuleUI.GUIToggle(s_Texts.alignToDirection, this.m_AlignToDirection, new GUILayoutOption[0]);
            ModuleUI.GUIFloat(s_Texts.randomDirectionAmount, this.m_RandomDirectionAmount, new GUILayoutOption[0]);
            ModuleUI.GUIFloat(s_Texts.sphericalDirectionAmount, this.m_SphericalDirectionAmount, new GUILayoutOption[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();
                    }
                }
            }
        }
Exemple #14
0
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (s_Texts == null)
            {
                s_Texts = new Texts();
            }
            int        intValue  = this.m_Type.intValue;
            int        num2      = this.m_TypeToGuiTypeIndex[intValue];
            bool       usesShell = this.GetUsesShell((ShapeTypes)intValue);
            int        index     = ModuleUI.GUIPopup(s_Texts.shape, num2, this.m_GuiNames);
            ShapeTypes types     = this.m_GuiTypes[index];

            if (index != num2)
            {
                intValue = (int)types;
            }
            switch (types)
            {
            case ShapeTypes.Sphere:
                ModuleUI.GUIFloat(s_Texts.radius, this.m_Radius);
                intValue = !ModuleUI.GUIToggle(s_Texts.emitFromShell, usesShell) ? 0 : 1;
                break;

            case ShapeTypes.HemiSphere:
                ModuleUI.GUIFloat(s_Texts.radius, this.m_Radius);
                intValue = !ModuleUI.GUIToggle(s_Texts.emitFromShell, usesShell) ? 2 : 3;
                break;

            case ShapeTypes.Cone:
            {
                ModuleUI.GUIFloat(s_Texts.coneAngle, this.m_Angle);
                ModuleUI.GUIFloat(s_Texts.radius, this.m_Radius);
                bool disabled = (intValue != 8) && (intValue != 9);
                EditorGUI.BeginDisabledGroup(disabled);
                ModuleUI.GUIFloat(s_Texts.coneLength, this.m_Length);
                EditorGUI.EndDisabledGroup();
                string[] options = new string[] { "Base", "Base Shell", "Volume", "Volume Shell" };
                int      num4    = this.ConvertConeTypeToConeEmitFrom((ShapeTypes)intValue);
                num4     = ModuleUI.GUIPopup(s_Texts.emitFrom, num4, options);
                intValue = (int)this.ConvertConeEmitFromToConeType(num4);
                break;
            }

            case ShapeTypes.Box:
                ModuleUI.GUIFloat(s_Texts.boxX, this.m_BoxX);
                ModuleUI.GUIFloat(s_Texts.boxY, this.m_BoxY);
                ModuleUI.GUIFloat(s_Texts.boxZ, this.m_BoxZ);
                break;

            case ShapeTypes.Mesh:
            {
                string[] strArray2 = new string[] { "Vertex", "Edge", "Triangle" };
                ModuleUI.GUIPopup(string.Empty, this.m_PlacementMode, strArray2);
                ModuleUI.GUIObject(s_Texts.mesh, this.m_Mesh);
                break;
            }

            case ShapeTypes.Circle:
                ModuleUI.GUIFloat(s_Texts.radius, this.m_Radius);
                ModuleUI.GUIFloat(s_Texts.arc, this.m_Arc);
                intValue = !ModuleUI.GUIToggle(s_Texts.emitFromEdge, usesShell) ? 10 : 11;
                break;

            case ShapeTypes.SingleSidedEdge:
                ModuleUI.GUIFloat(s_Texts.radius, this.m_Radius);
                break;
            }
            this.m_Type.intValue = intValue;
            ModuleUI.GUIToggle(s_Texts.randomDirection, this.m_RandomDirection);
        }
        public override void OnInspectorGUI(InitialModuleUI initial)
        {
            if (RendererModuleUI.s_Texts == null)
            {
                RendererModuleUI.s_Texts = new RendererModuleUI.Texts();
            }
            EditorGUI.BeginChangeCheck();
            RendererModuleUI.RenderMode renderMode = (RendererModuleUI.RenderMode)ModuleUI.GUIPopup(RendererModuleUI.s_Texts.renderMode, this.m_RenderMode, RendererModuleUI.s_Texts.particleTypes, new GUILayoutOption[0]);
            bool flag = EditorGUI.EndChangeCheck();

            if (!this.m_RenderMode.hasMultipleDifferentValues)
            {
                if (renderMode == RendererModuleUI.RenderMode.Mesh)
                {
                    EditorGUI.indentLevel++;
                    this.DoListOfMeshesGUI();
                    EditorGUI.indentLevel--;
                    if (flag && this.m_Meshes[0].objectReferenceInstanceIDValue == 0 && !this.m_Meshes[0].hasMultipleDifferentValues)
                    {
                        this.m_Meshes[0].objectReferenceValue = Resources.GetBuiltinResource(typeof(Mesh), "Cube.fbx");
                    }
                }
                else if (renderMode == RendererModuleUI.RenderMode.Stretch3D)
                {
                    EditorGUI.indentLevel++;
                    ModuleUI.GUIFloat(RendererModuleUI.s_Texts.cameraSpeedScale, this.m_CameraVelocityScale, new GUILayoutOption[0]);
                    ModuleUI.GUIFloat(RendererModuleUI.s_Texts.speedScale, this.m_VelocityScale, new GUILayoutOption[0]);
                    ModuleUI.GUIFloat(RendererModuleUI.s_Texts.lengthScale, this.m_LengthScale, new GUILayoutOption[0]);
                    EditorGUI.indentLevel--;
                }
                if (renderMode != RendererModuleUI.RenderMode.None)
                {
                    if (renderMode != RendererModuleUI.RenderMode.Mesh)
                    {
                        ModuleUI.GUIFloat(RendererModuleUI.s_Texts.normalDirection, this.m_NormalDirection, new GUILayoutOption[0]);
                    }
                    if (this.m_Material != null)
                    {
                        ModuleUI.GUIObject(RendererModuleUI.s_Texts.material, this.m_Material, new GUILayoutOption[0]);
                    }
                }
            }
            if (this.m_TrailMaterial != null)
            {
                ModuleUI.GUIObject(RendererModuleUI.s_Texts.trailMaterial, this.m_TrailMaterial, new GUILayoutOption[0]);
            }
            if (renderMode != RendererModuleUI.RenderMode.None)
            {
                if (!this.m_RenderMode.hasMultipleDifferentValues)
                {
                    ModuleUI.GUIPopup(RendererModuleUI.s_Texts.sortMode, this.m_SortMode, RendererModuleUI.s_Texts.sortTypes, new GUILayoutOption[0]);
                    ModuleUI.GUIFloat(RendererModuleUI.s_Texts.sortingFudge, this.m_SortingFudge, new GUILayoutOption[0]);
                    if (renderMode != RendererModuleUI.RenderMode.Mesh)
                    {
                        ModuleUI.GUIFloat(RendererModuleUI.s_Texts.minParticleSize, this.m_MinParticleSize, new GUILayoutOption[0]);
                        ModuleUI.GUIFloat(RendererModuleUI.s_Texts.maxParticleSize, this.m_MaxParticleSize, new GUILayoutOption[0]);
                    }
                    if (renderMode == RendererModuleUI.RenderMode.Billboard || renderMode == RendererModuleUI.RenderMode.Mesh)
                    {
                        bool flag2 = this.m_ParticleSystemUI.m_ParticleSystems.FirstOrDefault((ParticleSystem o) => o.shape.alignToDirection) != null;
                        if (flag2)
                        {
                            using (new EditorGUI.DisabledScope(true))
                            {
                                ModuleUI.GUIPopup(RendererModuleUI.s_Texts.space, 0, new string[]
                                {
                                    RendererModuleUI.s_Texts.spaces[2]
                                }, new GUILayoutOption[0]);
                            }
                            GUIContent gUIContent = EditorGUIUtility.TextContent("Using Align to Direction in the Shape Module forces the system to be rendered using Local Render Alignment.");
                            EditorGUILayout.HelpBox(gUIContent.text, MessageType.Info, true);
                        }
                        else
                        {
                            ModuleUI.GUIPopup(RendererModuleUI.s_Texts.space, this.m_RenderAlignment, RendererModuleUI.s_Texts.spaces, new GUILayoutOption[0]);
                        }
                    }
                    ModuleUI.GUIVector3Field(RendererModuleUI.s_Texts.pivot, this.m_Pivot, new GUILayoutOption[0]);
                    EditorGUI.BeginChangeCheck();
                    RendererModuleUI.s_VisualizePivot = ModuleUI.GUIToggle(RendererModuleUI.s_Texts.visualizePivot, RendererModuleUI.s_VisualizePivot, new GUILayoutOption[0]);
                    if (EditorGUI.EndChangeCheck())
                    {
                        EditorPrefs.SetBool("VisualizePivot", RendererModuleUI.s_VisualizePivot);
                    }
                }
                ModuleUI.GUIPopup(RendererModuleUI.s_Texts.maskingMode, this.m_MaskInteraction, RendererModuleUI.s_Texts.maskInteraction, new GUILayoutOption[0]);
                if (!this.m_RenderMode.hasMultipleDifferentValues)
                {
                    if (ModuleUI.GUIToggle(RendererModuleUI.s_Texts.useCustomVertexStreams, this.m_UseCustomVertexStreams, new GUILayoutOption[0]))
                    {
                        this.DoVertexStreamsGUI(renderMode);
                    }
                    EditorGUILayout.Space();
                    ModuleUI.GUIPopup(RendererModuleUI.s_Texts.castShadows, this.m_CastShadows, this.m_CastShadows.enumDisplayNames, new GUILayoutOption[0]);
                    using (new EditorGUI.DisabledScope(SceneView.IsUsingDeferredRenderingPath()))
                    {
                        ModuleUI.GUIToggle(RendererModuleUI.s_Texts.receiveShadows, this.m_ReceiveShadows, new GUILayoutOption[0]);
                    }
                    ModuleUI.GUIPopup(RendererModuleUI.s_Texts.motionVectors, this.m_MotionVectors, RendererModuleUI.s_Texts.motionVectorOptions, new GUILayoutOption[0]);
                    EditorGUILayout.SortingLayerField(RendererModuleUI.s_Texts.sortingLayer, this.m_SortingLayerID, ParticleSystemStyles.Get().popup, ParticleSystemStyles.Get().label);
                    ModuleUI.GUIInt(RendererModuleUI.s_Texts.sortingOrder, this.m_SortingOrder, new GUILayoutOption[0]);
                }
            }
            List <ParticleSystemRenderer> list = new List <ParticleSystemRenderer>();

            ParticleSystem[] particleSystems = this.m_ParticleSystemUI.m_ParticleSystems;
            for (int i = 0; i < particleSystems.Length; i++)
            {
                ParticleSystem particleSystem = particleSystems[i];
                list.Add(particleSystem.GetComponent <ParticleSystemRenderer>());
            }
            this.m_Probes.OnGUI(list.ToArray(), list.FirstOrDefault <ParticleSystemRenderer>(), true);
        }
Exemple #16
0
 public static float GUIFloat(GUIContent guiContent, SerializedProperty floatProp, params GUILayoutOption[] layoutOptions)
 {
     return(ModuleUI.GUIFloat(guiContent, floatProp, "g7", layoutOptions));
 }
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (ShapeModuleUI.s_Texts == null)
            {
                ShapeModuleUI.s_Texts = new ShapeModuleUI.Texts();
            }
            int  num       = this.m_Type.intValue;
            int  num2      = this.m_TypeToGuiTypeIndex[num];
            bool usesShell = this.GetUsesShell((ShapeModuleUI.ShapeTypes)num);
            int  num3      = ModuleUI.GUIPopup(ShapeModuleUI.s_Texts.shape, num2, this.m_GuiNames);

            ShapeModuleUI.ShapeTypes shapeTypes = this.m_GuiTypes[num3];
            if (num3 != num2)
            {
                num = (int)shapeTypes;
            }
            switch (shapeTypes)
            {
            case ShapeModuleUI.ShapeTypes.Sphere:
            {
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius);
                bool flag = ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.emitFromShell, usesShell);
                num = ((!flag) ? 0 : 1);
                break;
            }

            case ShapeModuleUI.ShapeTypes.Hemisphere:
            {
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius);
                bool flag2 = ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.emitFromShell, usesShell);
                num = ((!flag2) ? 2 : 3);
                break;
            }

            case ShapeModuleUI.ShapeTypes.Cone:
            {
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.coneAngle, this.m_Angle);
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius);
                bool disabled = num != 8 && num != 9;
                EditorGUI.BeginDisabledGroup(disabled);
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.coneLength, this.m_Length);
                EditorGUI.EndDisabledGroup();
                string[] options = new string[]
                {
                    "Base",
                    "Base Shell",
                    "Volume",
                    "Volume Shell"
                };
                int num4 = this.ConvertConeTypeToConeEmitFrom((ShapeModuleUI.ShapeTypes)num);
                num4 = ModuleUI.GUIPopup(ShapeModuleUI.s_Texts.emitFrom, num4, options);
                num  = (int)this.ConvertConeEmitFromToConeType(num4);
                break;
            }

            case ShapeModuleUI.ShapeTypes.Box:
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.boxX, this.m_BoxX);
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.boxY, this.m_BoxY);
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.boxZ, this.m_BoxZ);
                break;

            case ShapeModuleUI.ShapeTypes.Mesh:
            case ShapeModuleUI.ShapeTypes.MeshRenderer:
            case ShapeModuleUI.ShapeTypes.SkinnedMeshRenderer:
            {
                string[] options2 = new string[]
                {
                    "Vertex",
                    "Edge",
                    "Triangle"
                };
                ModuleUI.GUIPopup(string.Empty, this.m_PlacementMode, options2);
                if (shapeTypes == ShapeModuleUI.ShapeTypes.Mesh)
                {
                    ModuleUI.GUIObject(ShapeModuleUI.s_Texts.mesh, this.m_Mesh);
                }
                else if (shapeTypes == ShapeModuleUI.ShapeTypes.MeshRenderer)
                {
                    ModuleUI.GUIObject(ShapeModuleUI.s_Texts.meshRenderer, this.m_MeshRenderer);
                }
                else
                {
                    ModuleUI.GUIObject(ShapeModuleUI.s_Texts.skinnedMeshRenderer, this.m_SkinnedMeshRenderer);
                }
                ModuleUI.GUIToggleWithIntField(ShapeModuleUI.s_Texts.meshMaterialIndex, this.m_UseMeshMaterialIndex, this.m_MeshMaterialIndex, false);
                ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.useMeshColors, this.m_UseMeshColors);
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.meshNormalOffset, this.m_MeshNormalOffset);
                break;
            }

            case ShapeModuleUI.ShapeTypes.Circle:
            {
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius);
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.arc, this.m_Arc);
                bool flag3 = ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.emitFromEdge, usesShell);
                num = ((!flag3) ? 10 : 11);
                break;
            }

            case ShapeModuleUI.ShapeTypes.SingleSidedEdge:
                ModuleUI.GUIFloat(ShapeModuleUI.s_Texts.radius, this.m_Radius);
                break;
            }
            this.m_Type.intValue = num;
            ModuleUI.GUIToggle(ShapeModuleUI.s_Texts.randomDirection, this.m_RandomDirection);
        }
        public override void OnInspectorGUI(InitialModuleUI initial)
        {
            if (NoiseModuleUI.s_PreviewTextureDirty)
            {
                if (this.m_ParticleSystemUI.multiEdit)
                {
                    Color32[] array = new Color32[NoiseModuleUI.s_PreviewTexture.width * NoiseModuleUI.s_PreviewTexture.height];
                    for (int i = 0; i < array.Length; i++)
                    {
                        array[i] = new Color32(120, 120, 120, 255);
                    }
                    NoiseModuleUI.s_PreviewTexture.SetPixels32(array);
                    NoiseModuleUI.s_PreviewTexture.Apply(false);
                }
                else
                {
                    this.m_ParticleSystemUI.m_ParticleSystems[0].GenerateNoisePreviewTexture(NoiseModuleUI.s_PreviewTexture);
                }
                NoiseModuleUI.s_PreviewTextureDirty = false;
            }
            if (!base.isWindowView)
            {
                GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                GUILayout.BeginVertical(new GUILayoutOption[0]);
            }
            EditorGUI.BeginChangeCheck();
            bool flag  = ModuleUI.GUIToggle(NoiseModuleUI.s_Texts.separateAxes, this.m_SeparateAxes, new GUILayoutOption[0]);
            bool flag2 = EditorGUI.EndChangeCheck();

            EditorGUI.BeginChangeCheck();
            if (flag2 && !flag)
            {
                this.m_StrengthY.RemoveCurveFromEditor();
                this.m_StrengthZ.RemoveCurveFromEditor();
                this.m_RemapY.RemoveCurveFromEditor();
                this.m_RemapZ.RemoveCurveFromEditor();
            }
            if (!this.m_StrengthX.stateHasMultipleDifferentValues)
            {
                this.m_StrengthZ.SetMinMaxState(this.m_StrengthX.state, flag);
                this.m_StrengthY.SetMinMaxState(this.m_StrengthX.state, flag);
            }
            if (!this.m_RemapX.stateHasMultipleDifferentValues)
            {
                this.m_RemapZ.SetMinMaxState(this.m_RemapX.state, flag);
                this.m_RemapY.SetMinMaxState(this.m_RemapX.state, flag);
            }
            if (flag)
            {
                this.m_StrengthX.m_DisplayName = NoiseModuleUI.s_Texts.x;
                base.GUITripleMinMaxCurve(GUIContent.none, NoiseModuleUI.s_Texts.x, this.m_StrengthX, NoiseModuleUI.s_Texts.y, this.m_StrengthY, NoiseModuleUI.s_Texts.z, this.m_StrengthZ, null, new GUILayoutOption[0]);
            }
            else
            {
                this.m_StrengthX.m_DisplayName = NoiseModuleUI.s_Texts.strength;
                ModuleUI.GUIMinMaxCurve(NoiseModuleUI.s_Texts.strength, this.m_StrengthX, new GUILayoutOption[0]);
            }
            ModuleUI.GUIFloat(NoiseModuleUI.s_Texts.frequency, this.m_Frequency, new GUILayoutOption[0]);
            ModuleUI.GUIMinMaxCurve(NoiseModuleUI.s_Texts.scrollSpeed, this.m_ScrollSpeed, new GUILayoutOption[0]);
            ModuleUI.GUIToggle(NoiseModuleUI.s_Texts.damping, this.m_Damping, new GUILayoutOption[0]);
            int num = ModuleUI.GUIInt(NoiseModuleUI.s_Texts.octaves, this.m_Octaves, new GUILayoutOption[0]);

            using (new EditorGUI.DisabledScope(num == 1))
            {
                ModuleUI.GUIFloat(NoiseModuleUI.s_Texts.octaveMultiplier, this.m_OctaveMultiplier, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(NoiseModuleUI.s_Texts.octaveScale, this.m_OctaveScale, new GUILayoutOption[0]);
            }
            ModuleUI.GUIPopup(NoiseModuleUI.s_Texts.quality, this.m_Quality, NoiseModuleUI.s_Texts.qualityDropdown, new GUILayoutOption[0]);
            EditorGUI.BeginChangeCheck();
            bool flag3 = ModuleUI.GUIToggle(NoiseModuleUI.s_Texts.remap, this.m_RemapEnabled, new GUILayoutOption[0]);
            bool flag4 = EditorGUI.EndChangeCheck();

            if (flag4 && !flag3)
            {
                this.m_RemapX.RemoveCurveFromEditor();
                this.m_RemapY.RemoveCurveFromEditor();
                this.m_RemapZ.RemoveCurveFromEditor();
            }
            using (new EditorGUI.DisabledScope(!flag3))
            {
                if (flag)
                {
                    this.m_RemapX.m_DisplayName = NoiseModuleUI.s_Texts.x;
                    base.GUITripleMinMaxCurve(GUIContent.none, NoiseModuleUI.s_Texts.x, this.m_RemapX, NoiseModuleUI.s_Texts.y, this.m_RemapY, NoiseModuleUI.s_Texts.z, this.m_RemapZ, null, new GUILayoutOption[0]);
                }
                else
                {
                    this.m_RemapX.m_DisplayName = NoiseModuleUI.s_Texts.remap;
                    ModuleUI.GUIMinMaxCurve(NoiseModuleUI.s_Texts.remapCurve, this.m_RemapX, new GUILayoutOption[0]);
                }
            }
            ModuleUI.GUIMinMaxCurve(NoiseModuleUI.s_Texts.positionAmount, this.m_PositionAmount, new GUILayoutOption[0]);
            ModuleUI.GUIMinMaxCurve(NoiseModuleUI.s_Texts.rotationAmount, this.m_RotationAmount, new GUILayoutOption[0]);
            ModuleUI.GUIMinMaxCurve(NoiseModuleUI.s_Texts.sizeAmount, this.m_SizeAmount, new GUILayoutOption[0]);
            if (!base.isWindowView)
            {
                GUILayout.EndVertical();
            }
            if (EditorGUI.EndChangeCheck() || this.m_ScrollSpeed.scalar.floatValue != 0f || flag3 || flag2)
            {
                NoiseModuleUI.s_PreviewTextureDirty = true;
                this.m_ParticleSystemUI.m_ParticleEffectUI.m_Owner.Repaint();
            }
            if (this.m_ParticleSystemUI.multiEdit)
            {
                GUILayout.Label(NoiseModuleUI.s_Texts.previewTextureMultiEdit, this.previewTextureStyle, new GUILayoutOption[]
                {
                    GUILayout.ExpandWidth(true),
                    GUILayout.ExpandHeight(false)
                });
            }
            else
            {
                GUILayout.Label(NoiseModuleUI.s_Texts.previewTexture, this.previewTextureStyle, new GUILayoutOption[]
                {
                    GUILayout.ExpandWidth(true),
                    GUILayout.ExpandHeight(false)
                });
            }
            if (!base.isWindowView)
            {
                GUILayout.EndHorizontal();
            }
        }
 public override void OnInspectorGUI(InitialModuleUI initial)
 {
     ModuleUI.GUIFloat(ExternalForcesModuleUI.s_Texts.multiplier, this.m_Multiplier, new GUILayoutOption[0]);
 }
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (CollisionModuleUI.s_Texts == null)
            {
                CollisionModuleUI.s_Texts = new CollisionModuleUI.Texts();
            }
            string[] options = new string[2] {
                "Planes", "World"
            };
            CollisionModuleUI.CollisionTypes collisionTypes = (CollisionModuleUI.CollisionTypes)ModuleUI.GUIPopup(string.Empty, this.m_Type, options);
            CollisionModuleUI.CollisionModes collisionModes = CollisionModuleUI.CollisionModes.Mode3D;
            if (collisionTypes == CollisionModuleUI.CollisionTypes.Plane)
            {
                this.DoListOfPlanesGUI();
                EditorGUI.BeginChangeCheck();
                this.m_PlaneVisualizationType = (CollisionModuleUI.PlaneVizType)ModuleUI.GUIPopup(CollisionModuleUI.s_Texts.visualization, (int)this.m_PlaneVisualizationType, this.m_PlaneVizTypeNames);
                if (EditorGUI.EndChangeCheck())
                {
                    EditorPrefs.SetInt("PlaneColisionVizType", (int)this.m_PlaneVisualizationType);
                    if (this.m_PlaneVisualizationType == CollisionModuleUI.PlaneVizType.Solid)
                    {
                        this.SyncVisualization();
                    }
                    else
                    {
                        ParticleEffectUtils.ClearPlanes();
                    }
                }
                EditorGUI.BeginChangeCheck();
                this.m_ScaleGrid = ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.scalePlane, this.m_ScaleGrid, "f2");
                if (EditorGUI.EndChangeCheck())
                {
                    this.m_ScaleGrid = Mathf.Max(0.0f, this.m_ScaleGrid);
                    EditorPrefs.SetFloat("ScalePlaneColision", this.m_ScaleGrid);
                    this.SyncVisualization();
                }
            }
            else
            {
                collisionModes = (CollisionModuleUI.CollisionModes)ModuleUI.GUIPopup(CollisionModuleUI.s_Texts.collisionMode, this.m_CollisionMode, new string[2] {
                    "3D", "2D"
                });
            }
            EditorGUI.BeginChangeCheck();
            this.m_VisualizeBounds = ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.visualizeBounds, this.m_VisualizeBounds);
            if (EditorGUI.EndChangeCheck())
            {
                EditorPrefs.SetBool("VisualizeBounds", this.m_VisualizeBounds);
            }
            CollisionModuleUI.s_LastInteractedEditor = this;
            ModuleUI.GUIMinMaxCurve(CollisionModuleUI.s_Texts.dampen, this.m_Dampen);
            ModuleUI.GUIMinMaxCurve(CollisionModuleUI.s_Texts.bounce, this.m_Bounce);
            ModuleUI.GUIMinMaxCurve(CollisionModuleUI.s_Texts.lifetimeLoss, this.m_LifetimeLossOnCollision);
            double num1 = (double)ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.minKillSpeed, this.m_MinKillSpeed);

            if (collisionTypes != CollisionModuleUI.CollisionTypes.World || collisionModes == CollisionModuleUI.CollisionModes.Mode2D)
            {
                double num2 = (double)ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.radiusScale, this.m_RadiusScale);
            }
            if (collisionTypes == CollisionModuleUI.CollisionTypes.World)
            {
                ModuleUI.GUILayerMask(CollisionModuleUI.s_Texts.collidesWith, this.m_CollidesWith);
                ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.collidesWithDynamic, this.m_CollidesWithDynamic);
                if (collisionModes == CollisionModuleUI.CollisionModes.Mode3D)
                {
                    ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.interiorCollisions, this.m_InteriorCollisions);
                }
                ModuleUI.GUIInt(CollisionModuleUI.s_Texts.maxCollisionShapes, this.m_MaxCollisionShapes);
                ModuleUI.GUIPopup(CollisionModuleUI.s_Texts.quality, this.m_Quality, CollisionModuleUI.s_Texts.qualitySettings);
                if (this.m_Quality.intValue > 0)
                {
                    double num3 = (double)ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.voxelSize, this.m_VoxelSize);
                }
            }
            ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.collisionMessages, this.m_CollisionMessages);
        }
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (s_Texts == null)
            {
                s_Texts = new Texts();
            }
            if (s_PreviewTextureDirty)
            {
                base.m_ParticleSystemUI.m_ParticleSystem.GenerateNoisePreviewTexture(s_PreviewTexture);
                s_PreviewTextureDirty = false;
            }
            bool flag = base.m_ParticleSystemUI.m_ParticleEffectUI.m_Owner is ParticleSystemInspector;

            if (flag)
            {
                GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                GUILayout.BeginVertical(new GUILayoutOption[0]);
            }
            EditorGUI.BeginChangeCheck();
            bool flag2 = ModuleUI.GUIToggle(s_Texts.separateAxes, this.m_SeparateAxes, new GUILayoutOption[0]);
            bool flag3 = EditorGUI.EndChangeCheck();

            EditorGUI.BeginChangeCheck();
            if (flag3)
            {
                if (flag2)
                {
                    this.m_StrengthX.RemoveCurveFromEditor();
                    this.m_RemapX.RemoveCurveFromEditor();
                }
                else
                {
                    this.m_StrengthX.RemoveCurveFromEditor();
                    this.m_StrengthY.RemoveCurveFromEditor();
                    this.m_StrengthZ.RemoveCurveFromEditor();
                    this.m_RemapX.RemoveCurveFromEditor();
                    this.m_RemapY.RemoveCurveFromEditor();
                    this.m_RemapZ.RemoveCurveFromEditor();
                }
            }
            MinMaxCurveState state = this.m_StrengthX.state;

            this.m_StrengthY.state = state;
            this.m_StrengthZ.state = state;
            state = this.m_RemapX.state;
            this.m_RemapY.state = state;
            this.m_RemapZ.state = state;
            if (flag2)
            {
                this.m_StrengthX.m_DisplayName = s_Texts.x;
                base.GUITripleMinMaxCurve(GUIContent.none, s_Texts.x, this.m_StrengthX, s_Texts.y, this.m_StrengthY, s_Texts.z, this.m_StrengthZ, null, new GUILayoutOption[0]);
            }
            else
            {
                this.m_StrengthX.m_DisplayName = s_Texts.strength;
                ModuleUI.GUIMinMaxCurve(s_Texts.strength, this.m_StrengthX, new GUILayoutOption[0]);
            }
            ModuleUI.GUIFloat(s_Texts.frequency, this.m_Frequency, new GUILayoutOption[0]);
            ModuleUI.GUIMinMaxCurve(s_Texts.scrollSpeed, this.m_ScrollSpeed, new GUILayoutOption[0]);
            ModuleUI.GUIToggle(s_Texts.damping, this.m_Damping, new GUILayoutOption[0]);
            int num = ModuleUI.GUIInt(s_Texts.octaves, this.m_Octaves, new GUILayoutOption[0]);

            using (new EditorGUI.DisabledScope(num == 1))
            {
                ModuleUI.GUIFloat(s_Texts.octaveMultiplier, this.m_OctaveMultiplier, new GUILayoutOption[0]);
                ModuleUI.GUIFloat(s_Texts.octaveScale, this.m_OctaveScale, new GUILayoutOption[0]);
            }
            ModuleUI.GUIPopup(s_Texts.quality, this.m_Quality, s_Texts.qualityDropdown, new GUILayoutOption[0]);
            bool flag4 = ModuleUI.GUIToggle(s_Texts.remap, this.m_RemapEnabled, new GUILayoutOption[0]);

            using (new EditorGUI.DisabledScope(!flag4))
            {
                if (flag2)
                {
                    this.m_RemapX.m_DisplayName = s_Texts.x;
                    base.GUITripleMinMaxCurve(GUIContent.none, s_Texts.x, this.m_RemapX, s_Texts.y, this.m_RemapY, s_Texts.z, this.m_RemapZ, null, new GUILayoutOption[0]);
                }
                else
                {
                    this.m_RemapX.m_DisplayName = s_Texts.remap;
                    ModuleUI.GUIMinMaxCurve(s_Texts.remapCurve, this.m_RemapX, new GUILayoutOption[0]);
                }
            }
            if (flag)
            {
                GUILayout.EndVertical();
            }
            if ((EditorGUI.EndChangeCheck() || (this.m_ScrollSpeed.scalar.floatValue > 0f)) || (flag4 || flag3))
            {
                s_PreviewTextureDirty = true;
                base.m_ParticleSystemUI.m_ParticleEffectUI.m_Owner.Repaint();
            }
            GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(false) };
            GUILayout.Label(s_Texts.previewTexture, this.previewTextureStyle, options);
            if (flag)
            {
                GUILayout.EndHorizontal();
            }
        }
Exemple #22
0
 public override void OnInspectorGUI(InitialModuleUI initial)
 {
     EditorGUI.BeginChangeCheck();
     CollisionModuleUI.CollisionTypes collisionTypes = (CollisionModuleUI.CollisionTypes)ModuleUI.GUIPopup(CollisionModuleUI.s_Texts.collisionType, this.m_Type, CollisionModuleUI.s_Texts.collisionTypes, new GUILayoutOption[0]);
     if (EditorGUI.EndChangeCheck())
     {
         this.SyncVisualization();
     }
     if (collisionTypes == CollisionModuleUI.CollisionTypes.Plane)
     {
         this.DoListOfPlanesGUI();
         EditorGUI.BeginChangeCheck();
         CollisionModuleUI.m_PlaneVisualizationType = (CollisionModuleUI.PlaneVizType)ModuleUI.GUIPopup(CollisionModuleUI.s_Texts.visualization, (int)CollisionModuleUI.m_PlaneVisualizationType, CollisionModuleUI.s_Texts.planeVizTypes, new GUILayoutOption[0]);
         if (EditorGUI.EndChangeCheck())
         {
             EditorPrefs.SetInt("PlaneColisionVizType", (int)CollisionModuleUI.m_PlaneVisualizationType);
         }
         EditorGUI.BeginChangeCheck();
         CollisionModuleUI.m_ScaleGrid = ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.scalePlane, CollisionModuleUI.m_ScaleGrid, "f2", new GUILayoutOption[0]);
         if (EditorGUI.EndChangeCheck())
         {
             CollisionModuleUI.m_ScaleGrid = Mathf.Max(0f, CollisionModuleUI.m_ScaleGrid);
             EditorPrefs.SetFloat("ScalePlaneColision", CollisionModuleUI.m_ScaleGrid);
         }
         ModuleUI.GUIButtonGroup(CollisionModuleUI.s_Texts.sceneViewEditModes, CollisionModuleUI.s_Texts.toolContents, new Func <Bounds>(this.GetBounds), this.m_ParticleSystemUI.m_ParticleEffectUI.m_Owner.customEditor);
     }
     else
     {
         ModuleUI.GUIPopup(CollisionModuleUI.s_Texts.collisionMode, this.m_CollisionMode, CollisionModuleUI.s_Texts.collisionModes, new GUILayoutOption[0]);
     }
     ModuleUI.GUIMinMaxCurve(CollisionModuleUI.s_Texts.dampen, this.m_Dampen, new GUILayoutOption[0]);
     ModuleUI.GUIMinMaxCurve(CollisionModuleUI.s_Texts.bounce, this.m_Bounce, new GUILayoutOption[0]);
     ModuleUI.GUIMinMaxCurve(CollisionModuleUI.s_Texts.lifetimeLoss, this.m_LifetimeLossOnCollision, new GUILayoutOption[0]);
     ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.minKillSpeed, this.m_MinKillSpeed, new GUILayoutOption[0]);
     ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.maxKillSpeed, this.m_MaxKillSpeed, new GUILayoutOption[0]);
     ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.radiusScale, this.m_RadiusScale, new GUILayoutOption[0]);
     if (collisionTypes == CollisionModuleUI.CollisionTypes.World)
     {
         ModuleUI.GUIPopup(CollisionModuleUI.s_Texts.quality, this.m_Quality, CollisionModuleUI.s_Texts.qualitySettings, new GUILayoutOption[0]);
         EditorGUI.indentLevel++;
         ModuleUI.GUILayerMask(CollisionModuleUI.s_Texts.collidesWith, this.m_CollidesWith, new GUILayoutOption[0]);
         ModuleUI.GUIInt(CollisionModuleUI.s_Texts.maxCollisionShapes, this.m_MaxCollisionShapes, new GUILayoutOption[0]);
         if (this.m_Quality.intValue == 0)
         {
             ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.collidesWithDynamic, this.m_CollidesWithDynamic, new GUILayoutOption[0]);
         }
         else
         {
             ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.voxelSize, this.m_VoxelSize, new GUILayoutOption[0]);
         }
         EditorGUI.indentLevel--;
         ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.colliderForce, this.m_ColliderForce, new GUILayoutOption[0]);
         EditorGUI.indentLevel++;
         ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.multiplyColliderForceByCollisionAngle, this.m_MultiplyColliderForceByCollisionAngle, new GUILayoutOption[0]);
         ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.multiplyColliderForceByParticleSpeed, this.m_MultiplyColliderForceByParticleSpeed, new GUILayoutOption[0]);
         ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.multiplyColliderForceByParticleSize, this.m_MultiplyColliderForceByParticleSize, new GUILayoutOption[0]);
         EditorGUI.indentLevel--;
     }
     ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.collisionMessages, this.m_CollisionMessages, new GUILayoutOption[0]);
     EditorGUI.BeginChangeCheck();
     CollisionModuleUI.s_VisualizeBounds = ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.visualizeBounds, CollisionModuleUI.s_VisualizeBounds, new GUILayoutOption[0]);
     if (EditorGUI.EndChangeCheck())
     {
         EditorPrefs.SetBool("VisualizeBounds", CollisionModuleUI.s_VisualizeBounds);
     }
 }
Exemple #23
0
 public static float GUIFloat(GUIContent guiContent, SerializedProperty floatProp)
 {
     return(ModuleUI.GUIFloat(guiContent, floatProp, "g7"));
 }
Exemple #24
0
        public override void OnInspectorGUI(ParticleSystem s)
        {
            if (s_Texts == null)
            {
                s_Texts = new Texts();
            }
            string[] options = new string[] { "Planes", "World" };
            EditorGUI.BeginChangeCheck();
            CollisionTypes types = (CollisionTypes)ModuleUI.GUIPopup("", this.m_Type, options, new GUILayoutOption[0]);
            bool           flag  = EditorGUI.EndChangeCheck();
            CollisionModes modes = CollisionModes.Mode3D;

            if (types == CollisionTypes.Plane)
            {
                this.DoListOfPlanesGUI();
                EditorGUI.BeginChangeCheck();
                this.m_PlaneVisualizationType = (PlaneVizType)ModuleUI.GUIPopup(s_Texts.visualization, (int)this.m_PlaneVisualizationType, this.m_PlaneVizTypeNames, new GUILayoutOption[0]);
                if (EditorGUI.EndChangeCheck() || flag)
                {
                    EditorPrefs.SetInt("PlaneColisionVizType", (int)this.m_PlaneVisualizationType);
                    if (this.m_PlaneVisualizationType == PlaneVizType.Solid)
                    {
                        this.SyncVisualization();
                    }
                    else
                    {
                        ParticleEffectUtils.ClearPlanes();
                    }
                }
                EditorGUI.BeginChangeCheck();
                this.m_ScaleGrid = ModuleUI.GUIFloat(s_Texts.scalePlane, this.m_ScaleGrid, "f2", new GUILayoutOption[0]);
                if (EditorGUI.EndChangeCheck())
                {
                    this.m_ScaleGrid = Mathf.Max(0f, this.m_ScaleGrid);
                    EditorPrefs.SetFloat("ScalePlaneColision", this.m_ScaleGrid);
                    this.SyncVisualization();
                }
            }
            else
            {
                ParticleEffectUtils.ClearPlanes();
                string[] textArray2 = new string[] { "3D", "2D" };
                modes = (CollisionModes)ModuleUI.GUIPopup(s_Texts.collisionMode, this.m_CollisionMode, textArray2, new GUILayoutOption[0]);
            }
            EditorGUI.BeginChangeCheck();
            s_VisualizeBounds = ModuleUI.GUIToggle(s_Texts.visualizeBounds, s_VisualizeBounds, new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                EditorPrefs.SetBool("VisualizeBounds", s_VisualizeBounds);
            }
            ModuleUI.GUIMinMaxCurve(s_Texts.dampen, this.m_Dampen, new GUILayoutOption[0]);
            ModuleUI.GUIMinMaxCurve(s_Texts.bounce, this.m_Bounce, new GUILayoutOption[0]);
            ModuleUI.GUIMinMaxCurve(s_Texts.lifetimeLoss, this.m_LifetimeLossOnCollision, new GUILayoutOption[0]);
            ModuleUI.GUIFloat(s_Texts.minKillSpeed, this.m_MinKillSpeed, new GUILayoutOption[0]);
            ModuleUI.GUIFloat(s_Texts.maxKillSpeed, this.m_MaxKillSpeed, new GUILayoutOption[0]);
            ModuleUI.GUIFloat(s_Texts.radiusScale, this.m_RadiusScale, new GUILayoutOption[0]);
            if (types == CollisionTypes.World)
            {
                ModuleUI.GUILayerMask(s_Texts.collidesWith, this.m_CollidesWith, new GUILayoutOption[0]);
                if (modes == CollisionModes.Mode3D)
                {
                    ModuleUI.GUIToggle(s_Texts.interiorCollisions, this.m_InteriorCollisions, new GUILayoutOption[0]);
                }
                ModuleUI.GUIInt(s_Texts.maxCollisionShapes, this.m_MaxCollisionShapes, new GUILayoutOption[0]);
                ModuleUI.GUIPopup(s_Texts.quality, this.m_Quality, s_Texts.qualitySettings, new GUILayoutOption[0]);
                if (this.m_Quality.intValue == 0)
                {
                    ModuleUI.GUIToggle(s_Texts.collidesWithDynamic, this.m_CollidesWithDynamic, new GUILayoutOption[0]);
                }
                else
                {
                    ModuleUI.GUIFloat(s_Texts.voxelSize, this.m_VoxelSize, new GUILayoutOption[0]);
                }
            }
            ModuleUI.GUIToggle(s_Texts.collisionMessages, this.m_CollisionMessages, new GUILayoutOption[0]);
        }