提交示例代码
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.IO;
|
||||
using Fantasy.ConfigTable;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Fantasy
|
||||
{
|
||||
public class AssetsBundleManager : IConfigTableAssetBundle
|
||||
{
|
||||
public string Combine(string assetBundleDirectoryPath, string dataConfig)
|
||||
{
|
||||
return Path.Combine(assetBundleDirectoryPath, $"{dataConfig}.bytes");
|
||||
}
|
||||
|
||||
public byte[] LoadConfigTable(string assetBundlePath)
|
||||
{
|
||||
#if UNITY_EDITOR || UNITY_EDITOR_64
|
||||
if (File.Exists(assetBundlePath))
|
||||
{
|
||||
return AssetDatabase.LoadAssetAtPath<TextAsset>(assetBundlePath).bytes;
|
||||
}
|
||||
UnityEngine.Debug.LogError($"assetBundlePath:{assetBundlePath} not exist");
|
||||
return null;
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user