public static void ShowWindow(PhysicalMaterialLibrary thisLibrary) { if (thisLibrary != null) { Control.library = thisLibrary; } var thisWindow = GetWindow <PhysicalMaterialEditor>(false, Loc.WINDOWTITLE, true); thisWindow.Reset(); }
public static void CreateNewMaterialLibrary() { var name = EditorUtility.SaveFilePanelInProject("Create New Physical Material Library", "PhysicalMaterialLibrary.asset", "asset", "Please enter a file name", "Assets"); if (name.Length != 0) { // create new scriptable object for the library, save it and then refresh library = ScriptableObject.CreateInstance <PhysicalMaterialLibrary>(); AssetDatabase.CreateAsset(library, name); AssetDatabase.SaveAssets(); // AssetDatabase.Refresh(); #if DEBUG_LOGGING Debug.Log("Created Physical Library: " + name); #endif } }