Beispiel #1
0
 public static void DeleteMaterialFromLibrary(PhysicalMaterialEntry entry)
 {
     if (entry != null)
     {
         if (library.entries.Contains(entry))
         {
             library.entries.Remove(entry);
         }
     }
 }
Beispiel #2
0
        public static void AddNewPhysicalMaterial()
        {
            var newMat = new PhysicalMaterialEntry
            {
                physicMaterial = CreatePhysicalMaterial()           // create the physicmaterial on disk
            };

            newMat.name = newMat.physicMaterial.name;
            library.entries.Add(newMat);
            AssetDatabase.SaveAssets();
            //   AssetDatabase.Refresh();
#if DEBUG_LOGGING
            Debug.Log("Added new material to library");
#endif
        }