diff --git a/meng_yao/Assets/Scenes/scene_Main.unity b/meng_yao/Assets/Scenes/scene_Main.unity index 9f89361a..053c722e 100644 --- a/meng_yao/Assets/Scenes/scene_Main.unity +++ b/meng_yao/Assets/Scenes/scene_Main.unity @@ -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 diff --git a/meng_yao/Assets/script/TanChuang/HeadTanchuang.cs b/meng_yao/Assets/script/TanChuang/HeadTanchuang.cs index 1c59612a..793e760a 100644 --- a/meng_yao/Assets/script/TanChuang/HeadTanchuang.cs +++ b/meng_yao/Assets/script/TanChuang/HeadTanchuang.cs @@ -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); } } diff --git a/meng_yao/Assets/script/scene_Main/Scene_main_jiekou.cs b/meng_yao/Assets/script/scene_Main/Scene_main_jiekou.cs index 3df5cae3..6edff07e 100644 --- a/meng_yao/Assets/script/scene_Main/Scene_main_jiekou.cs +++ b/meng_yao/Assets/script/scene_Main/Scene_main_jiekou.cs @@ -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(); diff --git a/meng_yao/Assets/script/scene_Main/ui/GiveawayPanel.cs b/meng_yao/Assets/script/scene_Main/ui/GiveawayPanel.cs index f160ec72..918fe731 100644 --- a/meng_yao/Assets/script/scene_Main/ui/GiveawayPanel.cs +++ b/meng_yao/Assets/script/scene_Main/ui/GiveawayPanel.cs @@ -11,7 +11,7 @@ public class GiveawayPanel : MonoBehaviour public GameObject Giveawayitem; public Transform Connact; - ImageLoader ImageLoader = new ImageLoader(); + List itemlist = new List(); void Start() @@ -32,7 +32,7 @@ public class GiveawayPanel : MonoBehaviour { GameObject obj = Instantiate(Giveawayitem, Connact); itemlist.Add(obj); - obj.GetComponent().head.sprite = await ImageLoader.LoadImageAsync(info.data.avatar_url); + obj.GetComponent().head.sprite = await Scene_main_jiekou.instance.ImageLoader.LoadImageAsync(info.data.avatar_url); obj.GetComponent().username.text = info.data.name; obj.GetComponent().uid = info.data.uid; obj.GetComponent().userid.text = info.data.uid;