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); }
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); }
private void Init() { if (this.m_PreviewUtility == null) { this.m_PreviewUtility = new PreviewRenderUtility(); this.m_PreviewUtility.camera.fieldOfView = 30f; this.m_Material = (EditorGUIUtility.GetBuiltinExtraResource(typeof(Material), "Default-Material.mat") as Material); this.m_WireMaterial = ModelInspector.CreateWireframeMaterial(); } }
private void InitPreview() { if (m_PreviewUtility == null) { m_PreviewUtility = new PreviewRenderUtility(); m_ShadedMesh = new Mesh(); m_ShadedMesh.hideFlags = HideFlags.HideAndDontSave; m_ShadedMesh.MarkDynamic(); m_GeometryMesh = new Mesh(); m_GeometryMesh.hideFlags = HideFlags.HideAndDontSave; m_GeometryMesh.MarkDynamic(); m_ShadedMaterialProperties = new MaterialPropertyBlock(); m_GeometryMaterial = Material.GetDefaultMaterial(); m_WireframeMaterial = ModelInspector.CreateWireframeMaterial(); EditorUtility.SetCameraAnimateMaterials(m_PreviewUtility.camera, true); } }
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); } }