| | |
| | | //needExt 是否需要函数内部添加后缀 |
| | | public T LoadAsset<T>(string directory, string name, bool needExt = true) where T : UnityEngine.Object |
| | | { |
| | | directory = directory.Replace("\\", "/"); |
| | | name = name.Replace("\\", "/"); |
| | | T asset = null; |
| | | // 特殊处理 因为有一层图集的关系 directory要传入的应该是atlas的名字 |
| | | if (typeof(T) == typeof(Sprite)) |
| | |
| | | name = name.Substring(name.LastIndexOf("/") + 1); |
| | | } |
| | | |
| | | directory = directory.Replace("\\", "/"); |
| | | } |
| | | |
| | | return LoadAssetInternal<T>(directory, name, needExt); |
| | |
| | | return LoadAssetInternal<Sprite>(atlasName, spriteName); |
| | | } |
| | | |
| | | //needExt 是否需要函数内部添加后缀 |
| | | public void LoadAssetAsync<T>(string directory, string name, Action<bool, UnityEngine.Object> callBack, bool needExt = true) where T : UnityEngine.Object |
| | | { |
| | | directory = directory.Replace("\\", "/"); |
| | | name = name.Replace("\\", "/"); |
| | | |
| | | // 特殊处理 因为有一层图集的关系 directory要传入的应该是atlas的名字 |
| | | if (typeof(T) == typeof(Sprite)) |
| | | { |