| | |
| | | public static async UniTask LoadSprite(string directory, string name, Image image, string failureName) |
| | | { |
| | | var sprite = await LoadSpriteAsync(directory, name); |
| | | if (image == null) return; |
| | | if (sprite != null) |
| | | { |
| | | if (image != null) |
| | | { |
| | | image.overrideSprite = sprite; |
| | | } |
| | | image.overrideSprite = sprite; |
| | | } |
| | | else |
| | | { |
| | |
| | | StringUtility.Concat(ResourcesPath.UI_TEXTURE_SUFFIX, "/" + iconConfig.folder), iconConfig.sprite, ct: ct); |
| | | } |
| | | |
| | | public static UniTask<Texture2D> LoadTexture2DPNGAsync(string name, CancellationToken ct = default) |
| | | public static async UniTask<Texture2D> LoadTexture2DPNGAsync(string name, CancellationToken ct = default) |
| | | { |
| | | return ResManager.Instance.LoadAssetAsync<Texture2D>( |
| | | StringUtility.Concat(ResourcesPath.UI_TEXTURE_SUFFIX, "/FullScreenBg"), name + ".png", false, ct); |
| | | var path = StringUtility.Concat(ResourcesPath.UI_TEXTURE_SUFFIX, "/FullScreenBg"); |
| | | var result = await ResManager.Instance.LoadAssetAsync<Texture2D>(path, name + ".png", false, ct); |
| | | return result; |
| | | } |
| | | } |