public static List <T> LoadAllAssetsAtPath <T>(string path) where T : Object { var assetsPath = UnityIOUtility.GetAssetsPath(path); var args = new object[] { assetsPath }; var objs = (object[])LoadAllAssetsAtPathMethod.Invoke(null, args); var assets = objs.OfType <T>().ToList(); return(assets); }
public static void CreateAsset(Object asset, string path, bool isDeletedExist = false) { var fullPath = UnityIOUtility.GetFullPath(path); if (File.Exists(fullPath) && isDeletedExist) { File.Delete(fullPath); Refresh(); } IOUtility.EnsureDirExist(fullPath); var assetsPath = UnityIOUtility.GetAssetsPath(fullPath); var arg = new object[] { asset, assetsPath }; CreateAssetMethod.Invoke(null, arg); }