添加解析url类

This commit is contained in:
liuliang 2025-01-04 15:34:17 +08:00
parent d7890c8dd8
commit 7c557a95db
4 changed files with 27 additions and 9 deletions

View File

@ -15143,6 +15143,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 768ed40e69788184b804035df928dc51, type: 3}
m_Name:
m_EditorClassIdentifier:
ImageLoader: {fileID: 0}
IsTaskLoging: 0
--- !u!114 &163050000
MonoBehaviour:
@ -31012,6 +31013,10 @@ PrefabInstance:
propertyPath: canvas
value:
objectReference: {fileID: 914645750}
- target: {fileID: 2094030769, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3}
propertyPath: head
value:
objectReference: {fileID: 1734045293}
- target: {fileID: 2094030769, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3}
propertyPath: canvas
value:
@ -31606,27 +31611,27 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3011360593699687250, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3011360593699687250, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3}
propertyPath: m_AnchorMin.y
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3011360593699687250, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3}
propertyPath: m_SizeDelta.x
value: 600
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3011360593699687250, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3}
propertyPath: m_SizeDelta.y
value: 733
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3011360593699687250, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3}
propertyPath: m_AnchoredPosition.x
value: 300
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3011360593699687250, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3}
propertyPath: m_AnchoredPosition.y
value: -366.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3011360593759919820, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3}
propertyPath: m_AnchorMax.y
@ -150374,6 +150379,17 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1733221808}
m_CullTransparentMesh: 1
--- !u!114 &1734045293 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 3011360593729086421, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3}
m_PrefabInstance: {fileID: 366819986}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1734504820
GameObject:
m_ObjectHideFlags: 0

View File

@ -13,7 +13,7 @@ public class HeadTanchuang : MonoBehaviour
public RectTransform AvatarRect;
Vector3 Deflate = new Vector3(0.5f, 0.5f, 0.5f);
public Transform canvas;
public Image head;
@ -45,5 +45,6 @@ public class HeadTanchuang : MonoBehaviour
PlayerInfoData _PlayerInfoData = await Scene_main_jiekou.instance.PlayerInfos();
this.Name.text =_PlayerInfoData.nickname.ToString();
this.Id.text = _PlayerInfoData.uid.ToString();
this.head.sprite = await Scene_main_jiekou.instance.ImageLoader.LoadImageAsync(_PlayerInfoData.avatar_url);
}
}

View File

@ -7,6 +7,7 @@ using UnityEngine;
public class Scene_main_jiekou :MonoBehaviour
{
public ImageLoader ImageLoader = new ImageLoader();//½âÎöÍ·ÏñÀà
login _Login = new login();
logout logout = new logout();
treeInfo TreeInfoss = new treeInfo();

View File

@ -11,7 +11,7 @@ public class GiveawayPanel : MonoBehaviour
public GameObject Giveawayitem;
public Transform Connact;
ImageLoader ImageLoader = new ImageLoader();
List<GameObject> itemlist = new List<GameObject>();
void Start()
@ -32,7 +32,7 @@ public class GiveawayPanel : MonoBehaviour
{
GameObject obj = Instantiate(Giveawayitem, Connact);
itemlist.Add(obj);
obj.GetComponent<Giveawayitem>().head.sprite = await ImageLoader.LoadImageAsync(info.data.avatar_url);
obj.GetComponent<Giveawayitem>().head.sprite = await Scene_main_jiekou.instance.ImageLoader.LoadImageAsync(info.data.avatar_url);
obj.GetComponent<Giveawayitem>().username.text = info.data.name;
obj.GetComponent<Giveawayitem>().uid = info.data.uid;
obj.GetComponent<Giveawayitem>().userid.text = info.data.uid;