GUILayerMask() public static method

public static GUILayerMask ( GUIContent guiContent, UnityEditor.SerializedProperty boolProp ) : void
guiContent UnityEngine.GUIContent
boolProp UnityEditor.SerializedProperty
return void
 public override void OnInspectorGUI(ParticleSystem s)
 {
     if (CollisionModuleUI.s_Texts == null)
     {
         CollisionModuleUI.s_Texts = new CollisionModuleUI.Texts();
     }
     string[] options = new string[]
     {
         "Planes",
         "World"
     };
     CollisionModuleUI.CollisionTypes collisionTypes = (CollisionModuleUI.CollisionTypes)ModuleUI.GUIPopup(string.Empty, this.m_Type, options);
     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(0f, this.m_ScaleGrid);
             EditorPrefs.SetFloat("ScalePlaneColision", this.m_ScaleGrid);
             this.SyncVisualization();
         }
     }
     ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.dampen, this.m_Dampen);
     ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.bounce, this.m_Bounce);
     ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.lifetimeLoss, this.m_LifetimeLossOnCollision);
     ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.minKillSpeed, this.m_MinKillSpeed);
     if (collisionTypes != CollisionModuleUI.CollisionTypes.World)
     {
         ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.particleRadius, this.m_ParticleRadius);
     }
     if (collisionTypes == CollisionModuleUI.CollisionTypes.World)
     {
         ModuleUI.GUILayerMask(CollisionModuleUI.s_Texts.collidesWith, this.m_CollidesWith);
         ModuleUI.GUIPopup(CollisionModuleUI.s_Texts.quality, this.m_Quality, CollisionModuleUI.s_Texts.qualitySettings);
         if (this.m_Quality.intValue > 0)
         {
             ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.voxelSize, this.m_VoxelSize);
         }
     }
     ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.collisionMessages, this.m_CollisionMessages);
 }
示例#2
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);
     }
 }
        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);
        }
示例#4
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]);
        }