public static void DestroyNonAssetMaterial(Material material, bool bRegisterUndo) { // If the material is not part of the asset database then delete it if (material != null && !HEU_AssetDatabase.ContainsAsset(material)) { //Debug.LogFormat("Destroying non-asset material {0}", material.name); HEU_GeneralUtility.DestroyImmediate(material, false, bRegisterUndo: bRegisterUndo); } }
/// <summary> /// Returns true if given gameobjet is in Project only, and not in scene. /// </summary> /// <param name="go"></param> /// <returns></returns> public static bool IsGameObjectInProject(GameObject go) { return HEU_AssetDatabase.ContainsAsset(go); }