Inheritance: AssetImporter
Beispiel #1
0
        private ProceduralMaterial GetSelectedMaterial()
        {
            SubstanceImporter  importer = this.GetImporter();
            ProceduralMaterial result;

            if (importer == null)
            {
                result = null;
            }
            else
            {
                ProceduralMaterial[] sortedMaterials    = this.GetSortedMaterials();
                ProceduralMaterial   proceduralMaterial = Array.Find <ProceduralMaterial>(sortedMaterials, (ProceduralMaterial element) => element.name == this.m_SelectedMaterialInstanceName);
                if (this.m_SelectedMaterialInstanceName == null || proceduralMaterial == null)
                {
                    if (sortedMaterials.Length > 0)
                    {
                        proceduralMaterial = sortedMaterials[0];
                        this.m_SelectedMaterialInstanceName = proceduralMaterial.name;
                    }
                }
                result = proceduralMaterial;
            }
            return(result);
        }
Beispiel #2
0
        private void SelectNextMaterial()
        {
            SubstanceImporter importer = this.GetImporter();

            if (!(importer == null))
            {
                string selectedMaterialInstanceName  = null;
                ProceduralMaterial[] sortedMaterials = this.GetSortedMaterials();
                for (int i = 0; i < sortedMaterials.Length; i++)
                {
                    if (sortedMaterials[i].name == this.m_SelectedMaterialInstanceName)
                    {
                        int num = Math.Min(i + 1, sortedMaterials.Length - 1);
                        if (num == i)
                        {
                            num--;
                        }
                        if (num >= 0)
                        {
                            selectedMaterialInstanceName = sortedMaterials[num].name;
                        }
                        break;
                    }
                }
                this.m_SelectedMaterialInstanceName = selectedMaterialInstanceName;
            }
        }
Beispiel #3
0
        private void MaterialManagement()
        {
            SubstanceImporter importer = this.GetImporter();

            if (this.m_PrototypeNames == null)
            {
                this.m_PrototypeNames = importer.GetPrototypeNames();
            }
            ProceduralMaterial selectedMaterial = this.GetSelectedMaterial();

            GUILayout.BeginHorizontal(this.m_SubstanceStyles.toolbar, new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            using (new EditorGUI.DisabledScope(EditorApplication.isPlaying))
            {
                if (this.m_PrototypeNames.Length > 1)
                {
                    Rect rect = GUILayoutUtility.GetRect(this.m_SubstanceStyles.iconToolbarPlus, this.m_SubstanceStyles.toolbarDropDown);
                    if (EditorGUI.DropdownButton(rect, this.m_SubstanceStyles.iconToolbarPlus, FocusType.Passive, this.m_SubstanceStyles.toolbarDropDown))
                    {
                        GenericMenu genericMenu = new GenericMenu();
                        for (int i = 0; i < this.m_PrototypeNames.Length; i++)
                        {
                            genericMenu.AddItem(new GUIContent(this.m_PrototypeNames[i]), false, new GenericMenu.MenuFunction2(this.InstanciatePrototype), this.m_PrototypeNames[i]);
                        }
                        genericMenu.DropDown(rect);
                    }
                }
                else if (this.m_PrototypeNames.Length == 1)
                {
                    if (GUILayout.Button(this.m_SubstanceStyles.iconToolbarPlus, this.m_SubstanceStyles.toolbarButton, new GUILayoutOption[0]))
                    {
                        this.m_SelectedMaterialInstanceName = this.GetImporter().InstantiateMaterial(this.m_PrototypeNames[0]);
                        this.ApplyAndRefresh(true);
                    }
                }
                using (new EditorGUI.DisabledScope(selectedMaterial == null))
                {
                    if (GUILayout.Button(this.m_SubstanceStyles.iconToolbarMinus, this.m_SubstanceStyles.toolbarButton, new GUILayoutOption[0]))
                    {
                        if (this.GetSortedMaterials().Length > 1)
                        {
                            this.SelectNextMaterial();
                            importer.DestroyMaterial(selectedMaterial);
                            this.ApplyAndRefresh(true);
                        }
                    }
                    if (GUILayout.Button(this.m_SubstanceStyles.iconDuplicate, this.m_SubstanceStyles.toolbarButton, new GUILayoutOption[0]))
                    {
                        string text = importer.CloneMaterial(selectedMaterial);
                        if (text != "")
                        {
                            this.m_SelectedMaterialInstanceName = text;
                            this.ApplyAndRefresh(true);
                        }
                    }
                }
            }
            EditorGUILayout.EndHorizontal();
        }
Beispiel #4
0
 internal static bool IsProceduralTextureSlot(Material material, Texture tex, string name)
 {
     if (material is ProceduralMaterial && tex is ProceduralTexture && SubstanceImporter.CanShaderPropertyHostProceduralOutput(name, (tex as ProceduralTexture).GetProceduralOutputType()))
     {
         return(SubstanceImporter.IsSubstanceParented(tex as ProceduralTexture, material as ProceduralMaterial));
     }
     return(false);
 }
Beispiel #5
0
        private ProceduralMaterial[] GetSortedMaterials()
        {
            SubstanceImporter importer = this.GetImporter();

            ProceduralMaterial[] materials = importer.GetMaterials();
            Array.Sort(materials, new SubstanceImporterInspector.SubstanceNameComparer());
            return(materials);
        }
        private void MaterialManagement()
        {
            SubstanceImporter importer = this.GetImporter();

            if (this.m_PrototypeNames == null)
            {
                this.m_PrototypeNames = importer.GetPrototypeNames();
            }
            ProceduralMaterial selectedMaterial = this.GetSelectedMaterial();

            GUILayout.BeginHorizontal(this.m_SubstanceStyles.toolbar, new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            EditorGUI.BeginDisabledGroup(EditorApplication.isPlaying);
            if (this.m_PrototypeNames.Length > 1)
            {
                Rect rect = GUILayoutUtility.GetRect(this.m_SubstanceStyles.iconToolbarPlus, this.m_SubstanceStyles.toolbarDropDown);
                if (EditorGUI.ButtonMouseDown(rect, this.m_SubstanceStyles.iconToolbarPlus, FocusType.Passive, this.m_SubstanceStyles.toolbarDropDown))
                {
                    GenericMenu genericMenu = new GenericMenu();
                    for (int index = 0; index < this.m_PrototypeNames.Length; ++index)
                    {
                        genericMenu.AddItem(new GUIContent(this.m_PrototypeNames[index]), false, new GenericMenu.MenuFunction2(this.InstanciatePrototype), (object)this.m_PrototypeNames[index]);
                    }
                    genericMenu.DropDown(rect);
                }
            }
            else if (this.m_PrototypeNames.Length == 1 && GUILayout.Button(this.m_SubstanceStyles.iconToolbarPlus, this.m_SubstanceStyles.toolbarButton, new GUILayoutOption[0]))
            {
                this.m_SelectedMaterialInstanceName = this.GetImporter().InstantiateMaterial(this.m_PrototypeNames[0]);
                this.ApplyAndRefresh(true);
            }
            EditorGUI.BeginDisabledGroup((UnityEngine.Object)selectedMaterial == (UnityEngine.Object)null);
            if (GUILayout.Button(this.m_SubstanceStyles.iconToolbarMinus, this.m_SubstanceStyles.toolbarButton, new GUILayoutOption[0]) && this.GetSortedMaterials().Length > 1)
            {
                this.SelectNextMaterial();
                importer.DestroyMaterial(selectedMaterial);
                this.ApplyAndRefresh(true);
            }
            if (GUILayout.Button(this.m_SubstanceStyles.iconDuplicate, this.m_SubstanceStyles.toolbarButton, new GUILayoutOption[0]))
            {
                string str = importer.CloneMaterial(selectedMaterial);
                if (str != string.Empty)
                {
                    this.m_SelectedMaterialInstanceName = str;
                    this.ApplyAndRefresh(true);
                }
            }
            EditorGUI.EndDisabledGroup();
            EditorGUI.EndDisabledGroup();
            EditorGUILayout.EndHorizontal();
        }
 protected override void OnDisable()
 {
     base.OnDisable();
     if (!EditorApplication.isPlaying && !InternalEditorUtility.ignoreInspectorChanges && this.m_MightHaveModified)
     {
         this.m_MightHaveModified = false;
         string[]             array   = new string[base.targets.GetLength(0)];
         int                  num     = 0;
         UnityEngine.Object[] targets = base.targets;
         for (int i = 0; i < targets.Length; i++)
         {
             ProceduralTexture proceduralTexture = (ProceduralTexture)targets[i];
             string            assetPath         = AssetDatabase.GetAssetPath(proceduralTexture);
             SubstanceImporter substanceImporter = AssetImporter.GetAtPath(assetPath) as SubstanceImporter;
             if (substanceImporter)
             {
                 substanceImporter.OnTextureInformationsChanged(proceduralTexture);
             }
             assetPath = AssetDatabase.GetAssetPath(proceduralTexture.GetProceduralMaterial());
             bool flag = false;
             for (int j = 0; j < num; j++)
             {
                 if (array[j] == assetPath)
                 {
                     flag = true;
                     break;
                 }
             }
             if (!flag)
             {
                 array[num++] = assetPath;
             }
         }
         for (int k = 0; k < num; k++)
         {
             SubstanceImporter substanceImporter2 = AssetImporter.GetAtPath(array[k]) as SubstanceImporter;
             if (substanceImporter2 && EditorUtility.IsDirty(substanceImporter2.GetInstanceID()))
             {
                 AssetDatabase.ImportAsset(array[k], ImportAssetOptions.ForceUncompressedImport);
             }
         }
     }
 }
        protected override void OnDisable()
        {
            base.OnDisable();
            if (EditorApplication.isPlaying || InternalEditorUtility.ignoreInspectorChanges || !this.m_MightHaveModified)
            {
                return;
            }
            this.m_MightHaveModified = false;
            string[] strArray = new string[this.targets.GetLength(0)];
            int      num      = 0;

            foreach (ProceduralTexture target in this.targets)
            {
                SubstanceImporter atPath = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath((Object)target)) as SubstanceImporter;
                if ((bool)((Object)atPath))
                {
                    atPath.OnTextureInformationsChanged(target);
                }
                string assetPath = AssetDatabase.GetAssetPath((Object)target.GetProceduralMaterial());
                bool   flag      = false;
                for (int index = 0; index < num; ++index)
                {
                    if (strArray[index] == assetPath)
                    {
                        flag = true;
                        break;
                    }
                }
                if (!flag)
                {
                    strArray[num++] = assetPath;
                }
            }
            for (int index = 0; index < num; ++index)
            {
                SubstanceImporter atPath = AssetImporter.GetAtPath(strArray[index]) as SubstanceImporter;
                if ((bool)((Object)atPath) && EditorUtility.IsDirty(atPath.GetInstanceID()))
                {
                    AssetDatabase.ImportAsset(strArray[index], ImportAssetOptions.ForceUncompressedImport);
                }
            }
        }
        private ProceduralMaterial GetSelectedMaterial()
        {
            SubstanceImporter importer = this.GetImporter();

            if (importer == null)
            {
                return(null);
            }
            ProceduralMaterial[] sortedMaterials = this.GetSortedMaterials();
            if (this.m_SelectedMaterialInstanceName != null)
            {
                return(Array.Find <ProceduralMaterial>(sortedMaterials, (ProceduralMaterial element) => element.name == this.m_SelectedMaterialInstanceName));
            }
            if (sortedMaterials.Length > 0)
            {
                this.m_SelectedMaterialInstanceName = sortedMaterials[0].name;
                return(sortedMaterials[0]);
            }
            return(null);
        }
 protected override void OnDisable()
 {
     base.OnDisable();
     if ((!EditorApplication.isPlaying && !InternalEditorUtility.ignoreInspectorChanges) && this.m_MightHaveModified)
     {
         this.m_MightHaveModified = false;
         string[] strArray = new string[base.targets.GetLength(0)];
         int      num      = 0;
         foreach (ProceduralTexture texture in base.targets)
         {
             SubstanceImporter atPath = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(texture)) as SubstanceImporter;
             if (atPath != null)
             {
                 atPath.OnTextureInformationsChanged(texture);
             }
             string assetPath = AssetDatabase.GetAssetPath(texture.GetProceduralMaterial());
             bool   flag      = false;
             for (int j = 0; j < num; j++)
             {
                 if (strArray[j] == assetPath)
                 {
                     flag = true;
                     break;
                 }
             }
             if (!flag)
             {
                 strArray[num++] = assetPath;
             }
         }
         for (int i = 0; i < num; i++)
         {
             SubstanceImporter importer2 = AssetImporter.GetAtPath(strArray[i]) as SubstanceImporter;
             if ((importer2 != null) && EditorUtility.IsDirty(importer2.GetInstanceID()))
             {
                 AssetDatabase.ImportAsset(strArray[i], ImportAssetOptions.ForceUncompressedImport);
             }
         }
     }
 }
 internal override void OnHeaderTitleGUI(Rect titleRect, string header)
 {
     ProceduralMaterial target = base.target as ProceduralMaterial;
     m_Importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(base.target)) as SubstanceImporter;
     if (m_Importer != null)
     {
         string name = target.name;
         name = EditorGUI.DelayedTextField(titleRect, name, EditorStyles.textField);
         if (name != target.name)
         {
             if (m_Importer.RenameMaterial(target, name))
             {
                 AssetDatabase.ImportAsset(m_Importer.assetPath, ImportAssetOptions.ForceUncompressedImport);
                 GUIUtility.ExitGUI();
             }
             else
             {
                 name = target.name;
             }
         }
     }
 }
		public static void ExportBitmaps(MenuCommand command)
		{
			string assetPath = AssetDatabase.GetAssetPath(command.context);
			ProceduralMaterialInspector.m_Importer = (AssetImporter.GetAtPath(assetPath) as SubstanceImporter);
			ProceduralMaterialInspector.m_Importer.ExportBitmaps(command.context as ProceduralMaterial);
		}
		protected void RecordForUndo(ProceduralMaterial material, SubstanceImporter importer, string message)
		{
			if (importer)
			{
				Undo.RecordObjects(new UnityEngine.Object[]
				{
					material,
					importer
				}, message);
			}
			else
			{
				Undo.RecordObject(material, message);
			}
		}
 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();
   }
 }
 internal override void OnHeaderTitleGUI(Rect titleRect, string header)
 {
   ProceduralMaterial target = this.target as ProceduralMaterial;
   ProceduralMaterialInspector.m_Importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(this.target)) as SubstanceImporter;
   if ((UnityEngine.Object) ProceduralMaterialInspector.m_Importer == (UnityEngine.Object) null)
     return;
   string name1 = target.name;
   string name2 = EditorGUI.DelayedTextField(titleRect, name1, EditorStyles.textField);
   if (!(name2 != target.name))
     return;
   if (ProceduralMaterialInspector.m_Importer.RenameMaterial(target, name2))
   {
     AssetDatabase.ImportAsset(ProceduralMaterialInspector.m_Importer.assetPath, ImportAssetOptions.ForceUncompressedImport);
     GUIUtility.ExitGUI();
   }
   else
   {
     string name3 = target.name;
   }
 }
 protected void RecordForUndo(ProceduralMaterial material, SubstanceImporter importer, string message)
 {
   if ((bool) ((UnityEngine.Object) importer))
     Undo.RecordObjects(new UnityEngine.Object[2]
     {
       (UnityEngine.Object) material,
       (UnityEngine.Object) importer
     }, message);
   else
     Undo.RecordObject((UnityEngine.Object) material, message);
 }
 public static void ResetSubstance(MenuCommand command)
 {
     m_Importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(command.context)) as SubstanceImporter;
     m_Importer.ResetMaterial(command.context as ProceduralMaterial);
 }
 protected void RecordForUndo(ProceduralMaterial material, SubstanceImporter importer, string message)
 {
     if (importer != null)
     {
         Object[] objectsToUndo = new Object[] { material, importer };
         Undo.RecordObjects(objectsToUndo, message);
     }
     else
     {
         Undo.RecordObject(material, message);
     }
 }
		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();
		}
Beispiel #20
0
        private static string GetObjectTypeName(UnityEngine.Object o)
        {
            string result;

            if (o == null)
            {
                result = "Nothing Selected";
            }
            else if (o is GameObject)
            {
                result = o.name;
            }
            else if (o is TagManager)
            {
                result = "Tags & Layers";
            }
            else if (o is Component)
            {
                MonoBehaviour monoBehaviour = o as MonoBehaviour;
                if (monoBehaviour)
                {
                    string scriptClassName = monoBehaviour.GetScriptClassName();
                    if (scriptClassName == "InvalidStateMachineBehaviour")
                    {
                        result = monoBehaviour.name + " (Script)";
                    }
                    else
                    {
                        result = scriptClassName + " (Script)";
                    }
                }
                else
                {
                    MeshFilter meshFilter = o as MeshFilter;
                    if (meshFilter)
                    {
                        Mesh sharedMesh = meshFilter.sharedMesh;
                        result = ((!sharedMesh) ? "[none]" : sharedMesh.name) + " (MeshFilter)";
                    }
                    else
                    {
                        result = o.GetType().Name;
                    }
                }
            }
            else if (o is AssetImporter)
            {
                MonoImporter monoImporter = o as MonoImporter;
                if (monoImporter)
                {
                    MonoScript script = monoImporter.GetScript();
                    result = "Default References (" + ((!script) ? string.Empty : script.name) + ")";
                }
                else
                {
                    SubstanceImporter substanceImporter = o as SubstanceImporter;
                    if (substanceImporter)
                    {
                        MonoScript substanceArchive = substanceImporter.GetSubstanceArchive();
                        if (substanceArchive)
                        {
                            result = substanceArchive.name + " (Substance Archive)";
                            return(result);
                        }
                    }
                    result = o.GetType().Name;
                }
            }
            else
            {
                result = o.name + " (" + o.GetType().Name + ")";
            }
            return(result);
        }
 public override void OnInspectorGUI()
 {
     using (new EditorGUI.DisabledScope(AnimationMode.InAnimationMode()))
     {
         this.m_MightHaveModified = true;
         if (this.m_Styles == null)
         {
             this.m_Styles = new Styles();
         }
         ProceduralMaterial target = base.target as ProceduralMaterial;
         m_Importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(base.target)) as SubstanceImporter;
         if (m_Importer == null)
         {
             this.DisplayRestrictedInspector();
         }
         else
         {
             if (m_Material != target)
             {
                 m_Material = target;
                 m_ShaderPMaterial = target.shader;
             }
             if (base.isVisible && (target.shader != null))
             {
                 if (m_ShaderPMaterial != target.shader)
                 {
                     m_ShaderPMaterial = target.shader;
                     foreach (ProceduralMaterial material2 in base.targets)
                     {
                         (AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(material2)) as SubstanceImporter).OnShaderModified(material2);
                     }
                 }
                 if (base.PropertiesGUI())
                 {
                     m_ShaderPMaterial = target.shader;
                     foreach (ProceduralMaterial material3 in base.targets)
                     {
                         (AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(material3)) as SubstanceImporter).OnShaderModified(material3);
                     }
                     base.PropertiesChanged();
                 }
                 GUILayout.Space(5f);
                 this.ProceduralProperties();
                 GUILayout.Space(15f);
                 this.GeneratedTextures();
             }
         }
     }
 }
		internal override void OnHeaderTitleGUI(Rect titleRect, string header)
		{
			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)
			{
				return;
			}
			string text = proceduralMaterial.name;
			text = EditorGUI.DelayedTextField(titleRect, text, null, EditorStyles.textField);
			if (text != proceduralMaterial.name)
			{
				if (ProceduralMaterialInspector.m_Importer.RenameMaterial(proceduralMaterial, text))
				{
					AssetDatabase.ImportAsset(ProceduralMaterialInspector.m_Importer.assetPath, ImportAssetOptions.ForceUncompressedImport);
					GUIUtility.ExitGUI();
				}
				else
				{
					text = proceduralMaterial.name;
				}
			}
		}