-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathSetTextureExtensions.cs
More file actions
26 lines (23 loc) · 943 Bytes
/
SetTextureExtensions.cs
File metadata and controls
26 lines (23 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using UnityEngine.UI;
using UnityGameFramework.Runtime;
namespace UGFExtensions.Texture
{
/// <summary>
/// 设置图片扩展
/// </summary>
public static partial class SetTextureExtensions
{
public static void SetTextureByFileSystem(this RawImage rawImage, string file)
{
GameEntry.GetComponent<TextureSetComponent>().SetTextureByFileSystem(SetRawImage.Create(rawImage, file));
}
public static int SetTextureByNetwork(this RawImage rawImage, string file, string saveFilePath = null)
{
return GameEntry.GetComponent<TextureSetComponent>().SetTextureByNetwork(SetRawImage.Create(rawImage, file), saveFilePath);
}
public static int SetTextureByResources(this RawImage rawImage, string file)
{
return GameEntry.GetComponent<TextureSetComponent>().SetTextureByResources(SetRawImage.Create(rawImage, file));
}
}
}