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(); 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); } }