Beispiel #1
0
        public static string GetRawValue(AssetId id)
        {
            if (_Values.TryGetValue(id, out var result))
            {
                return(result);
            }

            LoadBundle(id);

            if (_Values.TryGetValue(id, out result))
            {
                return(result);
            }

            throw new Exception($"未在 {id.Bundle} 内找到名为 {id.Name} 的value");
        }
Beispiel #2
0
 /// <summary>
 /// 从对象池中取出对象
 /// </summary>
 /// <typeparam name="T">需要转换的类型</typeparam>
 /// <param name="assetPath"></param>
 /// <returns></returns>
 public static T Get <T>(string assetPath) where T : MonoBehaviour
 {
     return(Get <T>(AssetId.Parse(assetPath)));
 }
Beispiel #3
0
 public static T GetAsset <T>(string assetPath) where T : Object
 {
     return(GetAsset <T>(AssetId.Parse(assetPath)));
 }
Beispiel #4
0
 public static T GetValue <T>(string valuePath)
 {
     return(GetValue <T>(AssetId.Parse(valuePath, _DefaultBundle)));
 }
Beispiel #5
0
 /// <summary>
 ///     谨慎使用,若删除表后再获取会引起大量的重复载入
 /// </summary>
 public static bool DeleteTable(string tablePath)
 {
     return(_Tables.Remove(AssetId.Parse(tablePath, _DefaultBundle)));
 }
Beispiel #6
0
 private static T GetValue <T>(AssetId id)
 {
     return(JsonConvert.DeserializeObject <T>(GetRawValue(id)));
 }
Beispiel #7
0
 public static T GetValue <T>(string assetPath)
 {
     return(GetValue <T>(AssetId.Parse(assetPath)));
 }
Beispiel #8
0
 public static string GetRawValue(string assetPath)
 {
     return(GetRawValue(AssetId.Parse(assetPath)));
 }