示例#1
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);
     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);
         ModuleUI.GUIFloat(RendererModuleUI.s_Texts.speedScale, this.m_VelocityScale);
         ModuleUI.GUIFloat(RendererModuleUI.s_Texts.lengthScale, this.m_LengthScale);
         EditorGUI.indentLevel--;
     }
     if (renderMode != RendererModuleUI.RenderMode.Mesh)
     {
         ModuleUI.GUIFloat(RendererModuleUI.s_Texts.normalDirection, this.m_NormalDirection);
     }
     if (this.m_Material != null)
     {
         ModuleUI.GUIObject(RendererModuleUI.s_Texts.material, this.m_Material);
     }
     ModuleUI.GUIPopup(RendererModuleUI.s_Texts.sortMode, this.m_SortMode, RendererModuleUI.s_Texts.sortTypes);
     ModuleUI.GUIFloat(RendererModuleUI.s_Texts.sortingFudge, this.m_SortingFudge);
     ModuleUI.GUIPopup(RendererModuleUI.s_Texts.castShadows, this.m_CastShadows, this.m_CastShadows.enumDisplayNames);
     using (new EditorGUI.DisabledScope(SceneView.IsUsingDeferredRenderingPath()))
     {
         ModuleUI.GUIToggle(RendererModuleUI.s_Texts.receiveShadows, this.m_ReceiveShadows);
     }
     if (renderMode != RendererModuleUI.RenderMode.Mesh)
     {
         ModuleUI.GUIFloat(RendererModuleUI.s_Texts.minParticleSize, this.m_MinParticleSize);
         ModuleUI.GUIFloat(RendererModuleUI.s_Texts.maxParticleSize, this.m_MaxParticleSize);
     }
     EditorGUILayout.Space();
     EditorGUILayout.SortingLayerField(RendererModuleUI.s_Texts.sortingLayer, this.m_SortingLayerID, ParticleSystemStyles.Get().popup, ParticleSystemStyles.Get().label);
     ModuleUI.GUIInt(RendererModuleUI.s_Texts.sortingOrder, this.m_SortingOrder);
     if (renderMode == RendererModuleUI.RenderMode.Billboard)
     {
         ModuleUI.GUIPopup(RendererModuleUI.s_Texts.space, this.m_RenderAlignment, RendererModuleUI.s_Texts.spaces);
     }
     ModuleUI.GUIVector3Field(RendererModuleUI.s_Texts.pivot, this.m_Pivot);
     this.m_Probes.OnGUI(null, s.GetComponent <Renderer>(), true);
 }
示例#2
0
 protected override void Init()
 {
     if (this.m_CastShadows == null)
     {
         if (RendererModuleUI.s_Texts == null)
         {
             RendererModuleUI.s_Texts = new RendererModuleUI.Texts();
         }
         this.m_CastShadows         = base.GetProperty0("m_CastShadows");
         this.m_ReceiveShadows      = base.GetProperty0("m_ReceiveShadows");
         this.m_MotionVectors       = base.GetProperty0("m_MotionVectors");
         this.m_Material            = base.GetProperty0("m_Materials.Array.data[0]");
         this.m_TrailMaterial       = base.GetProperty0("m_Materials.Array.data[1]");
         this.m_SortingOrder        = base.GetProperty0("m_SortingOrder");
         this.m_RenderingLayerMask  = base.GetProperty0("m_RenderingLayerMask");
         this.m_SortingLayerID      = base.GetProperty0("m_SortingLayerID");
         this.m_RenderMode          = base.GetProperty0("m_RenderMode");
         this.m_MinParticleSize     = base.GetProperty0("m_MinParticleSize");
         this.m_MaxParticleSize     = base.GetProperty0("m_MaxParticleSize");
         this.m_CameraVelocityScale = base.GetProperty0("m_CameraVelocityScale");
         this.m_VelocityScale       = base.GetProperty0("m_VelocityScale");
         this.m_LengthScale         = base.GetProperty0("m_LengthScale");
         this.m_SortingFudge        = base.GetProperty0("m_SortingFudge");
         this.m_SortMode            = base.GetProperty0("m_SortMode");
         this.m_NormalDirection     = base.GetProperty0("m_NormalDirection");
         this.m_Probes = new RendererEditorBase.Probes();
         this.m_Probes.Initialize(base.serializedObject);
         this.m_RenderAlignment = base.GetProperty0("m_RenderAlignment");
         this.m_Pivot           = base.GetProperty0("m_Pivot");
         this.m_Meshes[0]       = base.GetProperty0("m_Mesh");
         this.m_Meshes[1]       = base.GetProperty0("m_Mesh1");
         this.m_Meshes[2]       = base.GetProperty0("m_Mesh2");
         this.m_Meshes[3]       = base.GetProperty0("m_Mesh3");
         List <SerializedProperty> list = new List <SerializedProperty>();
         for (int i = 0; i < this.m_Meshes.Length; i++)
         {
             if (i == 0 || this.m_Meshes[i].objectReferenceValue != null)
             {
                 list.Add(this.m_Meshes[i]);
             }
         }
         this.m_ShownMeshes                             = list.ToArray();
         this.m_MaskInteraction                         = base.GetProperty0("m_MaskInteraction");
         this.m_EnableGPUInstancing                     = base.GetProperty0("m_EnableGPUInstancing");
         this.m_UseCustomVertexStreams                  = base.GetProperty0("m_UseCustomVertexStreams");
         this.m_VertexStreams                           = base.GetProperty0("m_VertexStreams");
         this.m_VertexStreamsList                       = new ReorderableList(base.serializedObject, this.m_VertexStreams, true, true, true, true);
         this.m_VertexStreamsList.elementHeight         = 16f;
         this.m_VertexStreamsList.headerHeight          = 0f;
         this.m_VertexStreamsList.onAddDropdownCallback = new ReorderableList.AddDropdownCallbackDelegate(this.OnVertexStreamListAddDropdownCallback);
         this.m_VertexStreamsList.onCanRemoveCallback   = new ReorderableList.CanRemoveCallbackDelegate(this.OnVertexStreamListCanRemoveCallback);
         this.m_VertexStreamsList.drawElementCallback   = new ReorderableList.ElementCallbackDelegate(this.DrawVertexStreamListElementCallback);
         RendererModuleUI.s_VisualizePivot              = EditorPrefs.GetBool("VisualizePivot", false);
     }
 }
 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);
   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;
     double num1 = (double) ModuleUI.GUIFloat(RendererModuleUI.s_Texts.cameraSpeedScale, this.m_CameraVelocityScale);
     double num2 = (double) ModuleUI.GUIFloat(RendererModuleUI.s_Texts.speedScale, this.m_VelocityScale);
     double num3 = (double) ModuleUI.GUIFloat(RendererModuleUI.s_Texts.lengthScale, this.m_LengthScale);
     --EditorGUI.indentLevel;
   }
   if (renderMode != RendererModuleUI.RenderMode.Mesh)
   {
     double num4 = (double) ModuleUI.GUIFloat(RendererModuleUI.s_Texts.normalDirection, this.m_NormalDirection);
   }
   if (this.m_Material != null)
     ModuleUI.GUIObject(RendererModuleUI.s_Texts.material, this.m_Material);
   ModuleUI.GUIPopup(RendererModuleUI.s_Texts.sortMode, this.m_SortMode, RendererModuleUI.s_Texts.sortTypes);
   double num5 = (double) ModuleUI.GUIFloat(RendererModuleUI.s_Texts.sortingFudge, this.m_SortingFudge);
   ModuleUI.GUIPopup(RendererModuleUI.s_Texts.castShadows, this.m_CastShadows, this.m_CastShadows.enumDisplayNames);
   EditorGUI.BeginDisabledGroup(SceneView.IsUsingDeferredRenderingPath());
   ModuleUI.GUIToggle(RendererModuleUI.s_Texts.receiveShadows, this.m_ReceiveShadows);
   EditorGUI.EndDisabledGroup();
   double num6 = (double) ModuleUI.GUIFloat(RendererModuleUI.s_Texts.minParticleSize, this.m_MinParticleSize);
   double num7 = (double) ModuleUI.GUIFloat(RendererModuleUI.s_Texts.maxParticleSize, this.m_MaxParticleSize);
   EditorGUILayout.Space();
   EditorGUILayout.SortingLayerField(RendererModuleUI.s_Texts.sortingLayer, this.m_SortingLayerID, ParticleSystemStyles.Get().popup, ParticleSystemStyles.Get().label);
   ModuleUI.GUIInt(RendererModuleUI.s_Texts.sortingOrder, this.m_SortingOrder);
   if (renderMode == RendererModuleUI.RenderMode.Billboard)
     ModuleUI.GUIPopup(RendererModuleUI.s_Texts.space, this.m_RenderAlignment, RendererModuleUI.s_Texts.spaces);
   ModuleUI.GUIVector3Field(RendererModuleUI.s_Texts.pivot, this.m_Pivot);
   this.m_Probes.OnGUI((Object[]) null, s.GetComponent<Renderer>(), true);
 }
示例#4
0
        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]);
                    }
                }
            }
            bool flag2 = this.m_ParticleSystemUI.m_ParticleSystems.FirstOrDefault((ParticleSystem o) => o.trails.enabled) != null;

            if (flag2 && this.m_TrailMaterial != null)
            {
                ModuleUI.GUIObject(RendererModuleUI.s_Texts.trailMaterial, this.m_TrailMaterial, new GUILayoutOption[0]);
            }
            if (!this.m_RenderMode.hasMultipleDifferentValues)
            {
                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)
                    {
                        bool flag3 = this.m_ParticleSystemUI.m_ParticleSystems.FirstOrDefault((ParticleSystem o) => o.shape.alignToDirection) != null;
                        if (flag3)
                        {
                            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]);
                    }
                    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);
        }
		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);
			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);
					ModuleUI.GUIFloat(RendererModuleUI.s_Texts.speedScale, this.m_VelocityScale);
					ModuleUI.GUIFloat(RendererModuleUI.s_Texts.lengthScale, this.m_LengthScale);
					EditorGUI.indentLevel--;
				}
			}
			if (renderMode != RendererModuleUI.RenderMode.Mesh)
			{
				ModuleUI.GUIFloat(RendererModuleUI.s_Texts.normalDirection, this.m_NormalDirection);
			}
			if (this.m_Material != null)
			{
				ModuleUI.GUIObject(RendererModuleUI.s_Texts.material, this.m_Material);
			}
			ModuleUI.GUIPopup(RendererModuleUI.s_Texts.sortMode, this.m_SortMode, RendererModuleUI.s_Texts.sortTypes);
			ModuleUI.GUIFloat(RendererModuleUI.s_Texts.sortingFudge, this.m_SortingFudge);
			ModuleUI.GUIPopup(RendererModuleUI.s_Texts.castShadows, this.m_CastShadows, this.m_CastShadows.enumDisplayNames);
			ModuleUI.GUIToggle(RendererModuleUI.s_Texts.receiveShadows, this.m_ReceiveShadows);
			ModuleUI.GUIFloat(RendererModuleUI.s_Texts.maxParticleSize, this.m_MaxParticleSize);
			EditorGUILayout.Space();
			EditorGUILayout.SortingLayerField(RendererModuleUI.s_Texts.sortingLayer, this.m_SortingLayerID, ParticleSystemStyles.Get().popup, ParticleSystemStyles.Get().label);
			ModuleUI.GUIInt(RendererModuleUI.s_Texts.sortingOrder, this.m_SortingOrder);
			this.m_Probes.OnGUI(s.GetComponent<Renderer>(), true);
		}