public override void OnInspectorGUI() { EditorGUI.BeginDisabledGroup(AnimationMode.InAnimationMode()); this.m_MightHaveModified = true; if (this.m_Styles == null) this.m_Styles = new ProceduralMaterialInspector.Styles(); ProceduralMaterial target1 = this.target as ProceduralMaterial; ProceduralMaterialInspector.m_Importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(this.target)) as SubstanceImporter; if ((UnityEngine.Object) ProceduralMaterialInspector.m_Importer == (UnityEngine.Object) null) { this.DisplayRestrictedInspector(); } else { if ((UnityEngine.Object) ProceduralMaterialInspector.m_Material != (UnityEngine.Object) target1) { ProceduralMaterialInspector.m_Material = target1; ProceduralMaterialInspector.m_ShaderPMaterial = target1.shader; } if (!this.isVisible || (UnityEngine.Object) target1.shader == (UnityEngine.Object) null) return; if ((UnityEngine.Object) ProceduralMaterialInspector.m_ShaderPMaterial != (UnityEngine.Object) target1.shader) { ProceduralMaterialInspector.m_ShaderPMaterial = target1.shader; foreach (ProceduralMaterial target2 in this.targets) (AssetImporter.GetAtPath(AssetDatabase.GetAssetPath((UnityEngine.Object) target2)) as SubstanceImporter).OnShaderModified(target2); } if (this.PropertiesGUI()) { ProceduralMaterialInspector.m_ShaderPMaterial = target1.shader; foreach (ProceduralMaterial target2 in this.targets) (AssetImporter.GetAtPath(AssetDatabase.GetAssetPath((UnityEngine.Object) target2)) as SubstanceImporter).OnShaderModified(target2); this.PropertiesChanged(); } GUILayout.Space(5f); this.ProceduralProperties(); GUILayout.Space(15f); this.GeneratedTextures(); EditorGUI.EndDisabledGroup(); } }
public override void OnInspectorGUI() { EditorGUI.BeginDisabledGroup(AnimationMode.InAnimationMode()); this.m_MightHaveModified = true; if (this.m_Styles == null) { this.m_Styles = new ProceduralMaterialInspector.Styles(); } ProceduralMaterial proceduralMaterial = this.target as ProceduralMaterial; string assetPath = AssetDatabase.GetAssetPath(this.target); ProceduralMaterialInspector.m_Importer = (AssetImporter.GetAtPath(assetPath) as SubstanceImporter); if (ProceduralMaterialInspector.m_Importer == null) { this.DisplayRestrictedInspector(); return; } if (ProceduralMaterialInspector.m_Material != proceduralMaterial) { ProceduralMaterialInspector.m_Material = proceduralMaterial; ProceduralMaterialInspector.m_ShaderPMaterial = proceduralMaterial.shader; } if (!base.isVisible || proceduralMaterial.shader == null) { return; } if (ProceduralMaterialInspector.m_ShaderPMaterial != proceduralMaterial.shader) { ProceduralMaterialInspector.m_ShaderPMaterial = proceduralMaterial.shader; UnityEngine.Object[] targets = base.targets; for (int i = 0; i < targets.Length; i++) { ProceduralMaterial proceduralMaterial2 = (ProceduralMaterial)targets[i]; string assetPath2 = AssetDatabase.GetAssetPath(proceduralMaterial2); SubstanceImporter substanceImporter = AssetImporter.GetAtPath(assetPath2) as SubstanceImporter; substanceImporter.OnShaderModified(proceduralMaterial2); } } if (base.PropertiesGUI()) { ProceduralMaterialInspector.m_ShaderPMaterial = proceduralMaterial.shader; UnityEngine.Object[] targets2 = base.targets; for (int j = 0; j < targets2.Length; j++) { ProceduralMaterial proceduralMaterial3 = (ProceduralMaterial)targets2[j]; string assetPath3 = AssetDatabase.GetAssetPath(proceduralMaterial3); SubstanceImporter substanceImporter2 = AssetImporter.GetAtPath(assetPath3) as SubstanceImporter; substanceImporter2.OnShaderModified(proceduralMaterial3); } base.PropertiesChanged(); } GUILayout.Space(5f); this.ProceduralProperties(); GUILayout.Space(15f); this.GeneratedTextures(); EditorGUI.EndDisabledGroup(); }
internal void DisplayRestrictedInspector() { this.m_MightHaveModified = false; if (this.m_Styles == null) this.m_Styles = new ProceduralMaterialInspector.Styles(); ProceduralMaterial target = this.target as ProceduralMaterial; if ((UnityEngine.Object) ProceduralMaterialInspector.m_Material != (UnityEngine.Object) target) { ProceduralMaterialInspector.m_Material = target; ProceduralMaterialInspector.m_ShaderPMaterial = target.shader; } this.ProceduralProperties(); GUILayout.Space(15f); this.GeneratedTextures(); }
internal void DisplayRestrictedInspector() { this.m_MightHaveModified = false; if (this.m_Styles == null) { this.m_Styles = new ProceduralMaterialInspector.Styles(); } ProceduralMaterial proceduralMaterial = this.target as ProceduralMaterial; if (ProceduralMaterialInspector.m_Material != proceduralMaterial) { ProceduralMaterialInspector.m_Material = proceduralMaterial; ProceduralMaterialInspector.m_ShaderPMaterial = proceduralMaterial.shader; } this.ProceduralProperties(); GUILayout.Space(15f); this.GeneratedTextures(); }