Example #1
0
        public static void ShowWindow(PhysicalMaterialLibrary thisLibrary)
        {
            if (thisLibrary != null)
            {
                Control.library = thisLibrary;
            }
            var thisWindow = GetWindow <PhysicalMaterialEditor>(false, Loc.WINDOWTITLE, true);

            thisWindow.Reset();
        }
Example #2
0
        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
            }
        }