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);
 }
Beispiel #2
0
 protected override void Init()
 {
     if (this.m_Type == null)
     {
         if (CollisionModuleUI.s_Texts == null)
         {
             CollisionModuleUI.s_Texts = new CollisionModuleUI.Texts();
         }
         this.m_Type = base.GetProperty("type");
         List <SerializedProperty> list = new List <SerializedProperty>();
         for (int i = 0; i < this.m_Planes.Length; i++)
         {
             this.m_Planes[i] = base.GetProperty("plane" + i);
             if (i == 0 || this.m_Planes[i].objectReferenceValue != null)
             {
                 list.Add(this.m_Planes[i]);
             }
         }
         this.m_ShownPlanes             = list.ToArray();
         this.m_Dampen                  = new SerializedMinMaxCurve(this, CollisionModuleUI.s_Texts.dampen, "m_Dampen");
         this.m_Dampen.m_AllowCurves    = false;
         this.m_Bounce                  = new SerializedMinMaxCurve(this, CollisionModuleUI.s_Texts.bounce, "m_Bounce");
         this.m_Bounce.m_AllowCurves    = false;
         this.m_LifetimeLossOnCollision = new SerializedMinMaxCurve(this, CollisionModuleUI.s_Texts.lifetimeLoss, "m_EnergyLossOnCollision");
         this.m_LifetimeLossOnCollision.m_AllowCurves = false;
         this.m_MinKillSpeed = base.GetProperty("minKillSpeed");
         this.m_MaxKillSpeed = base.GetProperty("maxKillSpeed");
         this.m_RadiusScale  = base.GetProperty("radiusScale");
         CollisionModuleUI.m_PlaneVisualizationType = (CollisionModuleUI.PlaneVizType)EditorPrefs.GetInt("PlaneColisionVizType", 1);
         CollisionModuleUI.m_ScaleGrid       = EditorPrefs.GetFloat("ScalePlaneColision", 1f);
         CollisionModuleUI.s_VisualizeBounds = EditorPrefs.GetBool("VisualizeBounds", false);
         this.m_CollidesWith        = base.GetProperty("collidesWith");
         this.m_CollidesWithDynamic = base.GetProperty("collidesWithDynamic");
         this.m_MaxCollisionShapes  = base.GetProperty("maxCollisionShapes");
         this.m_Quality             = base.GetProperty("quality");
         this.m_VoxelSize           = base.GetProperty("voxelSize");
         this.m_CollisionMessages   = base.GetProperty("collisionMessages");
         this.m_CollisionMode       = base.GetProperty("collisionMode");
         this.m_ColliderForce       = base.GetProperty("colliderForce");
         this.m_MultiplyColliderForceByCollisionAngle = base.GetProperty("multiplyColliderForceByCollisionAngle");
         this.m_MultiplyColliderForceByParticleSpeed  = base.GetProperty("multiplyColliderForceByParticleSpeed");
         this.m_MultiplyColliderForceByParticleSize   = base.GetProperty("multiplyColliderForceByParticleSize");
         this.SyncVisualization();
     }
 }
        protected override void Init()
        {
            if (this.m_Type != null)
            {
                return;
            }
            if (CollisionModuleUI.s_Texts == null)
            {
                CollisionModuleUI.s_Texts = new CollisionModuleUI.Texts();
            }
            this.m_Type = this.GetProperty("type");
            List <SerializedProperty> serializedPropertyList = new List <SerializedProperty>();

            for (int index = 0; index < this.m_Planes.Length; ++index)
            {
                this.m_Planes[index] = this.GetProperty("plane" + (object)index);
                if (index == 0 || this.m_Planes[index].objectReferenceValue != (Object)null)
                {
                    serializedPropertyList.Add(this.m_Planes[index]);
                }
            }
            this.m_ShownPlanes             = serializedPropertyList.ToArray();
            this.m_Dampen                  = new SerializedMinMaxCurve((ModuleUI)this, CollisionModuleUI.s_Texts.dampen, "m_Dampen");
            this.m_Dampen.m_AllowCurves    = false;
            this.m_Bounce                  = new SerializedMinMaxCurve((ModuleUI)this, CollisionModuleUI.s_Texts.bounce, "m_Bounce");
            this.m_Bounce.m_AllowCurves    = false;
            this.m_LifetimeLossOnCollision = new SerializedMinMaxCurve((ModuleUI)this, CollisionModuleUI.s_Texts.lifetimeLoss, "m_EnergyLossOnCollision");
            this.m_LifetimeLossOnCollision.m_AllowCurves = false;
            this.m_MinKillSpeed           = this.GetProperty("minKillSpeed");
            this.m_RadiusScale            = this.GetProperty("radiusScale");
            this.m_PlaneVisualizationType = (CollisionModuleUI.PlaneVizType)EditorPrefs.GetInt("PlaneColisionVizType", 1);
            this.m_ScaleGrid           = EditorPrefs.GetFloat("ScalePlaneColision", 1f);
            this.m_VisualizeBounds     = EditorPrefs.GetBool("VisualizeBounds", false);
            this.m_CollidesWith        = this.GetProperty("collidesWith");
            this.m_CollidesWithDynamic = this.GetProperty("collidesWithDynamic");
            this.m_InteriorCollisions  = this.GetProperty("interiorCollisions");
            this.m_MaxCollisionShapes  = this.GetProperty("maxCollisionShapes");
            this.m_Quality             = this.GetProperty("quality");
            this.m_VoxelSize           = this.GetProperty("voxelSize");
            this.m_CollisionMessages   = this.GetProperty("collisionMessages");
            this.m_CollisionMode       = this.GetProperty("collisionMode");
            this.SyncVisualization();
        }
 protected override void Init()
 {
   if (this.m_Type != null)
     return;
   if (CollisionModuleUI.s_Texts == null)
     CollisionModuleUI.s_Texts = new CollisionModuleUI.Texts();
   this.m_Type = this.GetProperty("type");
   List<SerializedProperty> serializedPropertyList = new List<SerializedProperty>();
   for (int index = 0; index < this.m_Planes.Length; ++index)
   {
     this.m_Planes[index] = this.GetProperty("plane" + (object) index);
     if (index == 0 || this.m_Planes[index].objectReferenceValue != (Object) null)
       serializedPropertyList.Add(this.m_Planes[index]);
   }
   this.m_ShownPlanes = serializedPropertyList.ToArray();
   this.m_Dampen = new SerializedMinMaxCurve((ModuleUI) this, CollisionModuleUI.s_Texts.dampen, "m_Dampen");
   this.m_Dampen.m_AllowCurves = false;
   this.m_Bounce = new SerializedMinMaxCurve((ModuleUI) this, CollisionModuleUI.s_Texts.bounce, "m_Bounce");
   this.m_Bounce.m_AllowCurves = false;
   this.m_LifetimeLossOnCollision = new SerializedMinMaxCurve((ModuleUI) this, CollisionModuleUI.s_Texts.lifetimeLoss, "m_EnergyLossOnCollision");
   this.m_LifetimeLossOnCollision.m_AllowCurves = false;
   this.m_MinKillSpeed = this.GetProperty("minKillSpeed");
   this.m_RadiusScale = this.GetProperty("radiusScale");
   this.m_PlaneVisualizationType = (CollisionModuleUI.PlaneVizType) EditorPrefs.GetInt("PlaneColisionVizType", 1);
   this.m_ScaleGrid = EditorPrefs.GetFloat("ScalePlaneColision", 1f);
   this.m_VisualizeBounds = EditorPrefs.GetBool("VisualizeBounds", false);
   this.m_CollidesWith = this.GetProperty("collidesWith");
   this.m_CollidesWithDynamic = this.GetProperty("collidesWithDynamic");
   this.m_InteriorCollisions = this.GetProperty("interiorCollisions");
   this.m_MaxCollisionShapes = this.GetProperty("maxCollisionShapes");
   this.m_Quality = this.GetProperty("quality");
   this.m_VoxelSize = this.GetProperty("voxelSize");
   this.m_CollisionMessages = this.GetProperty("collisionMessages");
   this.m_CollisionMode = this.GetProperty("collisionMode");
   this.SyncVisualization();
 }
        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 (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 (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);
		}