示例#1
0
 protected override void Init()
 {
     if (this.m_Type != null)
     {
         return;
     }
     if (ShapeModuleUI.s_Texts == null)
     {
         ShapeModuleUI.s_Texts = new ShapeModuleUI.Texts();
     }
     this.m_Type                 = base.GetProperty("type");
     this.m_Radius               = base.GetProperty("radius");
     this.m_Angle                = base.GetProperty("angle");
     this.m_Length               = base.GetProperty("length");
     this.m_BoxX                 = base.GetProperty("boxX");
     this.m_BoxY                 = base.GetProperty("boxY");
     this.m_BoxZ                 = base.GetProperty("boxZ");
     this.m_Arc                  = base.GetProperty("arc");
     this.m_PlacementMode        = base.GetProperty("placementMode");
     this.m_Mesh                 = base.GetProperty("m_Mesh");
     this.m_MeshRenderer         = base.GetProperty("m_MeshRenderer");
     this.m_SkinnedMeshRenderer  = base.GetProperty("m_SkinnedMeshRenderer");
     this.m_MeshMaterialIndex    = base.GetProperty("m_MeshMaterialIndex");
     this.m_UseMeshMaterialIndex = base.GetProperty("m_UseMeshMaterialIndex");
     this.m_UseMeshColors        = base.GetProperty("m_UseMeshColors");
     this.m_MeshNormalOffset     = base.GetProperty("m_MeshNormalOffset");
     this.m_RandomDirection      = base.GetProperty("randomDirection");
     this.m_Material             = (EditorGUIUtility.GetBuiltinExtraResource(typeof(Material), "Default-Material.mat") as Material);
     this.m_BoxEditor.SetAlwaysDisplayHandles(true);
 }
        private void DrawMeshPreview(FrameDebuggerEvent curEvent, Rect previewRect, Rect meshInfoRect, Mesh mesh, int meshSubset)
        {
            if (this.m_PreviewUtility == null)
            {
                this.m_PreviewUtility = new PreviewRenderUtility();
                this.m_PreviewUtility.m_CameraFieldOfView = 30f;
            }
            if (this.m_Material == null)
            {
                this.m_Material = EditorGUIUtility.GetBuiltinExtraResource(typeof(Material), "Default-Material.mat") as Material;
            }
            if (this.m_WireMaterial == null)
            {
                this.m_WireMaterial = ModelInspector.CreateWireframeMaterial();
            }
            this.m_PreviewUtility.BeginPreview(previewRect, "preBackground");
            ModelInspector.RenderMeshPreview(mesh, this.m_PreviewUtility, this.m_Material, this.m_WireMaterial, this.m_PreviewDir, meshSubset);
            this.m_PreviewUtility.EndAndDrawPreview(previewRect);
            string name = mesh.name;

            if (string.IsNullOrEmpty(name))
            {
                name = "<no name>";
            }
            object[] objArray1 = new object[] { name, " subset ", meshSubset, "\n", curEvent.vertexCount, " verts, ", curEvent.indexCount, " indices" };
            string   text      = string.Concat(objArray1);

            EditorGUI.DropShadowLabel(meshInfoRect, text);
        }
示例#3
0
        private void DrawMeshPreview(FrameDebuggerEventData curEventData, Rect previewRect, Rect meshInfoRect, Mesh mesh, int meshSubset)
        {
            if (this.m_PreviewUtility == null)
            {
                this.m_PreviewUtility = new PreviewRenderUtility();
                this.m_PreviewUtility.m_CameraFieldOfView = 30f;
            }
            if ((UnityEngine.Object) this.m_Material == (UnityEngine.Object)null)
            {
                this.m_Material = EditorGUIUtility.GetBuiltinExtraResource(typeof(Material), "Default-Material.mat") as Material;
            }
            if ((UnityEngine.Object) this.m_WireMaterial == (UnityEngine.Object)null)
            {
                this.m_WireMaterial = ModelInspector.CreateWireframeMaterial();
            }
            this.m_PreviewUtility.BeginPreview(previewRect, (GUIStyle)"preBackground");
            ModelInspector.RenderMeshPreview(mesh, this.m_PreviewUtility, this.m_Material, this.m_WireMaterial, this.m_PreviewDir, meshSubset);
            this.m_PreviewUtility.EndAndDrawPreview(previewRect);
            string str = mesh.name;

            if (string.IsNullOrEmpty(str))
            {
                str = "<no name>";
            }
            string text = str + " subset " + (object)meshSubset + "\n" + (object)curEventData.vertexCount + " verts, " + (object)curEventData.indexCount + " indices";

            EditorGUI.DropShadowLabel(meshInfoRect, text);
        }
示例#4
0
 protected override void Init()
 {
     if (this.m_Type == null)
     {
         if (ShapeModuleUI.s_Texts == null)
         {
             ShapeModuleUI.s_Texts = new ShapeModuleUI.Texts();
         }
         this.m_Type                     = base.GetProperty("type");
         this.m_Radius                   = ShapeModuleUI.MultiModeParameter.GetProperty(this, "radius", ShapeModuleUI.s_RadiusTexts.speed);
         this.m_RadiusThickness          = base.GetProperty("radiusThickness");
         this.m_Angle                    = base.GetProperty("angle");
         this.m_Length                   = base.GetProperty("length");
         this.m_BoxThickness             = base.GetProperty("boxThickness");
         this.m_Arc                      = ShapeModuleUI.MultiModeParameter.GetProperty(this, "arc", ShapeModuleUI.s_ArcTexts.speed);
         this.m_DonutRadius              = base.GetProperty("donutRadius");
         this.m_PlacementMode            = base.GetProperty("placementMode");
         this.m_Mesh                     = base.GetProperty("m_Mesh");
         this.m_MeshRenderer             = base.GetProperty("m_MeshRenderer");
         this.m_SkinnedMeshRenderer      = base.GetProperty("m_SkinnedMeshRenderer");
         this.m_MeshMaterialIndex        = base.GetProperty("m_MeshMaterialIndex");
         this.m_UseMeshMaterialIndex     = base.GetProperty("m_UseMeshMaterialIndex");
         this.m_UseMeshColors            = base.GetProperty("m_UseMeshColors");
         this.m_MeshNormalOffset         = base.GetProperty("m_MeshNormalOffset");
         this.m_RandomDirectionAmount    = base.GetProperty("randomDirectionAmount");
         this.m_SphericalDirectionAmount = base.GetProperty("sphericalDirectionAmount");
         this.m_RandomPositionAmount     = base.GetProperty("randomPositionAmount");
         this.m_AlignToDirection         = base.GetProperty("alignToDirection");
         this.m_Position                 = base.GetProperty("m_Position");
         this.m_Scale                    = base.GetProperty("m_Scale");
         this.m_Rotation                 = base.GetProperty("m_Rotation");
         this.m_Material                 = (EditorGUIUtility.GetBuiltinExtraResource(typeof(Material), "Default-Material.mat") as Material);
     }
 }
示例#5
0
 private void Init()
 {
     if (this.m_PreviewUtility == null)
     {
         this.m_PreviewUtility = new PreviewRenderUtility();
         this.m_PreviewUtility.m_CameraFieldOfView = 30f;
         this.m_Material     = EditorGUIUtility.GetBuiltinExtraResource(typeof(Material), "Default-Material.mat") as Material;
         this.m_WireMaterial = CreateWireframeMaterial();
     }
 }
示例#6
0
 private void Init()
 {
     if (this.m_PreviewUtility == null)
     {
         this.m_PreviewUtility = new PreviewRenderUtility();
         this.m_PreviewUtility.m_CameraFieldOfView = 30f;
         this.m_Material                      = (EditorGUIUtility.GetBuiltinExtraResource(typeof(Material), "Default-Material.mat") as Material);
         this.m_WireMaterial                  = new Material(ModelInspector.WireframeShaderSource);
         this.m_WireMaterial.hideFlags        = HideFlags.HideAndDontSave;
         this.m_WireMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
     }
 }
 private void InitPreview()
 {
     if (this.m_PreviewUtility == null)
     {
         this.m_PreviewUtility       = new PreviewRenderUtility();
         this.m_ShadedMesh           = new Mesh();
         this.m_ShadedMesh.hideFlags = HideFlags.HideAndDontSave;
         this.m_ShadedMesh.MarkDynamic();
         this.m_GeometryMesh           = new Mesh();
         this.m_GeometryMesh.hideFlags = HideFlags.HideAndDontSave;
         this.m_GeometryMesh.MarkDynamic();
         this.m_ShadedMaterialProperties = new MaterialPropertyBlock();
         this.m_GeometryMaterial         = (EditorGUIUtility.GetBuiltinExtraResource(typeof(Material), "Default-Material.mat") as Material);
         this.m_WireframeMaterial        = ModelInspector.CreateWireframeMaterial();
         EditorUtility.SetCameraAnimateMaterials(this.m_PreviewUtility.m_Camera, true);
     }
 }
示例#8
0
        private void DrawMeshPreview(FrameDebuggerEvent curEvent, Rect previewRect, Rect meshInfoRect, Mesh mesh, int meshSubset)
        {
            if (this.m_PreviewUtility == null)
            {
                this.m_PreviewUtility = new PreviewRenderUtility();
                this.m_PreviewUtility.m_CameraFieldOfView = 30f;
            }
            if (this.m_Material == null)
            {
                this.m_Material = (EditorGUIUtility.GetBuiltinExtraResource(typeof(Material), "Default-Material.mat") as Material);
            }
            if (this.m_WireMaterial == null)
            {
                this.m_WireMaterial                  = new Material(ModelInspector.WireframeShaderSource);
                this.m_WireMaterial.hideFlags        = HideFlags.HideAndDontSave;
                this.m_WireMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
            }
            this.m_PreviewUtility.BeginPreview(previewRect, "preBackground");
            ModelInspector.RenderMeshPreview(mesh, this.m_PreviewUtility, this.m_Material, this.m_WireMaterial, this.m_PreviewDir, meshSubset);
            Texture image = this.m_PreviewUtility.EndPreview();

            GUI.DrawTexture(previewRect, image, ScaleMode.StretchToFill, false);
            string text = mesh.name;

            if (string.IsNullOrEmpty(text))
            {
                text = "<no name>";
            }
            string text2 = string.Concat(new object[]
            {
                text,
                " subset ",
                meshSubset,
                "\n",
                curEvent.vertexCount,
                " verts, ",
                curEvent.indexCount,
                " indices"
            });

            EditorGUI.DropShadowLabel(meshInfoRect, text2);
        }
示例#9
0
 protected override void Init()
 {
     if (this.m_Type == null)
     {
         if (s_Texts == null)
         {
             s_Texts = new Texts();
         }
         this.m_Type            = base.GetProperty("type");
         this.m_Radius          = base.GetProperty("radius");
         this.m_Angle           = base.GetProperty("angle");
         this.m_Length          = base.GetProperty("length");
         this.m_BoxX            = base.GetProperty("boxX");
         this.m_BoxY            = base.GetProperty("boxY");
         this.m_BoxZ            = base.GetProperty("boxZ");
         this.m_Arc             = base.GetProperty("arc");
         this.m_PlacementMode   = base.GetProperty("placementMode");
         this.m_Mesh            = base.GetProperty("m_Mesh");
         this.m_RandomDirection = base.GetProperty("randomDirection");
         this.m_Material        = EditorGUIUtility.GetBuiltinExtraResource(typeof(Material), "Default-Material.mat") as Material;
         this.m_BoxEditor.SetAlwaysDisplayHandles(true);
     }
 }
示例#10
0
 protected override void Init()
 {
     if (this.m_Type == null)
     {
         if (ShapeModuleUI.s_Texts == null)
         {
             ShapeModuleUI.s_Texts = new ShapeModuleUI.Texts();
         }
         this.m_Type                         = base.GetProperty("type");
         this.m_Radius                       = ShapeModuleUI.MultiModeParameter.GetProperty(this, "radius", ShapeModuleUI.s_RadiusTexts.speed);
         this.m_RadiusThickness              = base.GetProperty("radiusThickness");
         this.m_Angle                        = base.GetProperty("angle");
         this.m_Length                       = base.GetProperty("length");
         this.m_BoxThickness                 = base.GetProperty("boxThickness");
         this.m_Arc                          = ShapeModuleUI.MultiModeParameter.GetProperty(this, "arc", ShapeModuleUI.s_ArcTexts.speed);
         this.m_DonutRadius                  = base.GetProperty("donutRadius");
         this.m_PlacementMode                = base.GetProperty("placementMode");
         this.m_Mesh                         = base.GetProperty("m_Mesh");
         this.m_MeshRenderer                 = base.GetProperty("m_MeshRenderer");
         this.m_SkinnedMeshRenderer          = base.GetProperty("m_SkinnedMeshRenderer");
         this.m_MeshMaterialIndex            = base.GetProperty("m_MeshMaterialIndex");
         this.m_UseMeshMaterialIndex         = base.GetProperty("m_UseMeshMaterialIndex");
         this.m_UseMeshColors                = base.GetProperty("m_UseMeshColors");
         this.m_MeshNormalOffset             = base.GetProperty("m_MeshNormalOffset");
         this.m_Texture                      = base.GetProperty("m_Texture");
         this.m_TextureClipChannel           = base.GetProperty("m_TextureClipChannel");
         this.m_TextureClipThreshold         = base.GetProperty("m_TextureClipThreshold");
         this.m_TextureColorAffectsParticles = base.GetProperty("m_TextureColorAffectsParticles");
         this.m_TextureAlphaAffectsParticles = base.GetProperty("m_TextureAlphaAffectsParticles");
         this.m_TextureBilinearFiltering     = base.GetProperty("m_TextureBilinearFiltering");
         this.m_TextureUVChannel             = base.GetProperty("m_TextureUVChannel");
         this.m_RandomDirectionAmount        = base.GetProperty("randomDirectionAmount");
         this.m_SphericalDirectionAmount     = base.GetProperty("sphericalDirectionAmount");
         this.m_RandomPositionAmount         = base.GetProperty("randomPositionAmount");
         this.m_AlignToDirection             = base.GetProperty("alignToDirection");
         this.m_Position                     = base.GetProperty("m_Position");
         this.m_Scale                        = base.GetProperty("m_Scale");
         this.m_Rotation                     = base.GetProperty("m_Rotation");
         if (!ShapeModuleUI.s_Material)
         {
             ShapeModuleUI.s_Material = (EditorGUIUtility.GetBuiltinExtraResource(typeof(Material), "Default-Material.mat") as Material);
         }
         if (!ShapeModuleUI.s_TextureMaterial)
         {
             ShapeModuleUI.s_TextureMaterial = new Material((Shader)EditorGUIUtility.Load("SceneView/ParticleShapeGizmo.shader"));
         }
         if (!ShapeModuleUI.s_SphereTextureMaterial)
         {
             ShapeModuleUI.s_SphereTextureMaterial = new Material((Shader)EditorGUIUtility.Load("SceneView/ParticleShapeGizmoSphere.shader"));
         }
         if (!ShapeModuleUI.s_CircleMesh)
         {
             ShapeModuleUI.s_CircleMesh = ((GameObject)EditorGUIUtility.Load("SceneView/Circle.fbx")).transform.GetComponent <MeshFilter>().sharedMesh;
         }
         if (!ShapeModuleUI.s_QuadMesh)
         {
             ShapeModuleUI.s_QuadMesh = (Resources.GetBuiltinResource(typeof(Mesh), "Quad.fbx") as Mesh);
         }
         if (!ShapeModuleUI.s_SphereMesh)
         {
             ShapeModuleUI.s_SphereMesh = (Resources.GetBuiltinResource(typeof(Mesh), "New-Sphere.fbx") as Mesh);
         }
         if (!ShapeModuleUI.s_HemisphereMesh)
         {
             ShapeModuleUI.s_HemisphereMesh = ((GameObject)EditorGUIUtility.Load("SceneView/Hemisphere.fbx")).transform.GetComponent <MeshFilter>().sharedMesh;
         }
     }
 }