| | |
| | | using System.IO; |
| | | using UnityEngine.Networking; |
| | | using UnityEngine.Video; |
| | | using System.Reflection; |
| | | |
| | | |
| | | |
| | | #if UNITY_EDITOR |
| | |
| | | { |
| | | T asset = null; |
| | | |
| | | var path = string.Concat($"Assets/ResourcesOut/{directory}/{name}", GetExtension(typeof(T))).Replace("//", "/").Trim().Replace("\\", "/"); |
| | | |
| | | var path = ($"Assets/ResourcesOut/{directory}/{name}" + GetExtension(typeof(T))).Replace("//", "/").Trim().Replace("\\", "/"); |
| | | path = System.Text.RegularExpressions.Regex.Replace(path, @"[\p{C}]", ""); |
| | | if (AssetSource.uiFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | |
| | | |
| | | private Sprite LoadSprite(string atlasName, string spriteName) |
| | | { |
| | | // #if !UNITY_EDITOR |
| | | #if !UNITY_EDITOR |
| | | SpriteAtlas atlas = LoadAsset<SpriteAtlas>("Sprite", atlasName.Replace("Sprite/", "")); |
| | | return atlas.GetSprite(spriteName); |
| | | // #else |
| | | // return ResManager.Instance.LoadAssetInternal<Sprite>(atlasName, spriteName); |
| | | // #endif |
| | | #else |
| | | return ResManager.Instance.LoadAssetInternal<Sprite>(atlasName, spriteName); |
| | | #endif |
| | | } |
| | | |
| | | public void LoadAssetAsync<T>(string directory, string name, Action<bool, UnityEngine.Object> callBack) where T : UnityEngine.Object |