有头像接口的修改

This commit is contained in:
liuliang 2025-01-04 16:21:06 +08:00
parent abadd636a3
commit 98fe651416
8 changed files with 39 additions and 12 deletions

View File

@ -15143,7 +15143,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 768ed40e69788184b804035df928dc51, type: 3}
m_Name:
m_EditorClassIdentifier:
ImageLoader: {fileID: 0}
IsTaskLoging: 0
--- !u!114 &163050000
MonoBehaviour:
@ -29374,14 +29373,17 @@ MonoBehaviour:
FirstName: {fileID: 431895116}
Firstcount: {fileID: 1946594467}
FitstPrize: {fileID: 887733216}
Fitsthead: {fileID: 1548491210}
Secondlevel: {fileID: 2124241022}
SecondName: {fileID: 1999305026}
Secondcount: {fileID: 956425077}
SecondPrize: {fileID: 768282640}
Secondhead: {fileID: 2033015612}
Thirdlevel: {fileID: 1987729151}
ThirdName: {fileID: 95657181}
Thirdcount: {fileID: 1312713360}
ThirdPrize: {fileID: 1784087689}
Thirdhead: {fileID: 187716042}
Promotionitem: {fileID: 1908348284012044747, guid: b3cee309124aad94bb7e7397124dc142, type: 3}
Content: {fileID: 1439471775}
countdown: {fileID: 688128787}
@ -64266,7 +64268,7 @@ GameObject:
- component: {fileID: 729618846}
- component: {fileID: 729618845}
m_Layer: 5
m_Name: Image
m_Name: head
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -150965,6 +150967,7 @@ MonoBehaviour:
NameText: {fileID: 852761426}
IdText: {fileID: 1380548575}
island: {fileID: 1852295288}
head: {fileID: 729618845}
headTanchuang: {fileID: 136090572}
--- !u!1 &1744156003
GameObject:

View File

@ -45,6 +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);
this.head.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(_PlayerInfoData.avatar_url);
}
}

View File

@ -10,17 +10,19 @@ public class Promotion_Rank : MonoBehaviour
public Text FirstName;
public Text Firstcount;
public Text FitstPrize;
public Image Fitsthead;
public Text Secondlevel;
public Text SecondName;
public Text Secondcount;
public Text SecondPrize;
public Image Secondhead;
public Text Thirdlevel;
public Text ThirdName;
public Text Thirdcount;
public Text ThirdPrize;
public Image Thirdhead;
public GameObject Promotionitem;
public Transform Content;
@ -50,8 +52,9 @@ public class Promotion_Rank : MonoBehaviour
FirstName.text = response.data.ranks[0].nickname;
Firstcount.text = response.data.ranks[0].quantity + "/" + response.data.ranks[0].require;
FitstPrize.text = response.data.ranks[0].reward.ToString();
Fitsthead.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[0].avatar_url);
Secondlevel.text ="2";
Secondlevel.text ="2";
SecondName.text = "";
Secondcount.text = "";
SecondPrize.text = "";
@ -68,11 +71,13 @@ public class Promotion_Rank : MonoBehaviour
FirstName.text = response.data.ranks[0].nickname;
Firstcount.text = response.data.ranks[0].quantity + "/" + response.data.ranks[0].require;
FitstPrize.text = response.data.ranks[0].reward.ToString();
Fitsthead.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[0].avatar_url);
Secondlevel.text = response.data.ranks[1].rank.ToString();
SecondName.text = response.data.ranks[1].nickname;
Secondcount.text = response.data.ranks[1].quantity + "/" + response.data.ranks[1].require;
SecondPrize.text = response.data.ranks[1].reward.ToString();
Secondhead.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[1].avatar_url);
Thirdlevel.text = "3";
ThirdName.text = "";
@ -85,16 +90,19 @@ public class Promotion_Rank : MonoBehaviour
FirstName.text = response.data.ranks[0].nickname;
Firstcount.text = response.data.ranks[0].quantity + "/" + response.data.ranks[0].require;
FitstPrize.text = response.data.ranks[0].reward.ToString();
Fitsthead.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[0].avatar_url);
Secondlevel.text = response.data.ranks[1].rank.ToString();
Secondlevel.text = response.data.ranks[1].rank.ToString();
SecondName.text = response.data.ranks[1].nickname;
Secondcount.text = response.data.ranks[1].quantity + "/" + response.data.ranks[1].require;
SecondPrize.text = response.data.ranks[1].reward.ToString();
Secondhead.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[1].avatar_url);
Thirdlevel.text = response.data.ranks[2].rank.ToString();
Thirdlevel.text = response.data.ranks[2].rank.ToString();
ThirdName.text = response.data.ranks[2].nickname;
Thirdcount.text = response.data.ranks[2].quantity + "/" + response.data.ranks[2].require;
ThirdPrize.text = response.data.ranks[2].reward.ToString();
Thirdhead.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[2].avatar_url);
}
for (int i = 3; i < response.data.ranks.Count; i++)
@ -105,6 +113,7 @@ public class Promotion_Rank : MonoBehaviour
obj.GetComponent<Promotion_Rankitem>().username.text = response.data.ranks[i].nickname;
obj.GetComponent<Promotion_Rankitem>().prize.text = response.data.ranks[i].reward+"ÔªÏÖ½ð½±Àø";
obj.GetComponent<Promotion_Rankitem>().count.text = response.data.ranks[i].quantity + "/" + response.data.ranks[i].require;
obj.GetComponent<Promotion_Rankitem>().userImage.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[i].avatar_url);
}

View File

@ -10,6 +10,7 @@ public class ReviseName : mount
public Text NameText;
public Text IdText;
public Text island;
public Image head;
public GameObject headTanchuang;
// Start is called before the first frame update
@ -63,6 +64,7 @@ public class ReviseName : mount
this.NameText.text = info.nickname.ToString();
this.IdText.text = info.uid.ToString();
island.text = "³öÉúµØ£º"+info.island_name;
this.head.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(info.avatar_url);
this.gameObject.SetActive(true);
}
}

View File

@ -7,7 +7,7 @@ using UnityEngine;
public class Scene_main_jiekou :MonoBehaviour
{
public ImageLoader ImageLoader = new ImageLoader();//½âÎöÍ·ÏñÀà
ImageLoader ImageLoader = new ImageLoader();//½âÎöÍ·ÏñÀà
login _Login = new login();
logout logout = new logout();
treeInfo TreeInfoss = new treeInfo();
@ -68,6 +68,11 @@ public class Scene_main_jiekou :MonoBehaviour
IsTaskLoging = false;
}
public async Task<Sprite> ImageLoaderSprite(string url)
{
return await ImageLoader.LoadImageAsync(url);
}
public async Task<bool> Logouts()//登录退出
{
return await logout.Logout();

View File

@ -32,7 +32,7 @@ public class GiveawayPanel : MonoBehaviour
{
GameObject obj = Instantiate(Giveawayitem, Connact);
itemlist.Add(obj);
obj.GetComponent<Giveawayitem>().head.sprite = await Scene_main_jiekou.instance.ImageLoader.LoadImageAsync(info.data.avatar_url);
obj.GetComponent<Giveawayitem>().head.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(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;

View File

@ -55,7 +55,7 @@ public class IllustrationsAssetDetails : MonoBehaviour
WaterText.text = _PlayerInfoData.water.ToString("F2");
UserName.text = _PlayerInfoData.nickname.ToString();
UserID.text = _PlayerInfoData.uid.ToString();
UserHead.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(_PlayerInfoData.avatar_url);
_PlayerInfoData = null;
// 异步操作完成,标记为未执行
isUpdating = false;

View File

@ -44,6 +44,7 @@ public class QuanwangPanel : MonoBehaviour
quanwangListItemFirstobj.GetComponent<quanwangListItemFirst>().start[i].gameObject.SetActive(true);
}
quanwangListItemFirstobj.GetComponent<quanwangListItemFirst>().moneynumber.text = response.data.ranks[0].amount.ToString();
quanwangListItemFirstobj.GetComponent<quanwangListItemFirst>().headicon.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[0].avatar_url);
}
if (response.data.ranks.Length == 2)
{
@ -59,6 +60,7 @@ public class QuanwangPanel : MonoBehaviour
quanwangListItemFirstobj2.GetComponent<quanwangListItemFirst>().start[i].gameObject.SetActive(true);
}
quanwangListItemFirstobj2.GetComponent<quanwangListItemFirst>().moneynumber.text = response.data.ranks[0].amount.ToString();
quanwangListItemFirstobj2.GetComponent<quanwangListItemFirst>().headicon.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[0].avatar_url);
quanwangListItemScecondobj.GetComponent<quanwangListItemScecond>().username.text = response.data.ranks[1].nickname;
quanwangListItemScecondobj.GetComponent<quanwangListItemScecond>().userid.text = response.data.ranks[1].uid;
@ -67,6 +69,7 @@ public class QuanwangPanel : MonoBehaviour
quanwangListItemScecondobj.GetComponent<quanwangListItemScecond>().start[i].gameObject.SetActive(true);
}
quanwangListItemScecondobj.GetComponent<quanwangListItemScecond>().moneynumber.text = response.data.ranks[1].amount.ToString();
quanwangListItemScecondobj.GetComponent<quanwangListItemScecond>().headicon.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[1].avatar_url);
}
if (response.data.ranks.Length >= 3)
@ -84,22 +87,25 @@ public class QuanwangPanel : MonoBehaviour
quanwangListItemFirstobj3.GetComponent<quanwangListItemFirst>().start[i].gameObject.SetActive(true);
}
quanwangListItemFirstobj3.GetComponent<quanwangListItemFirst>().moneynumber.text = response.data.ranks[0].amount.ToString();
quanwangListItemFirstobj3.GetComponent<quanwangListItemFirst>().headicon.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[0].avatar_url);
quanwangListItemScecondobj2.GetComponent<quanwangListItemScecond>().username.text = response.data.ranks[1].nickname;
quanwangListItemScecondobj2.GetComponent<quanwangListItemScecond>().username.text = response.data.ranks[1].nickname;
quanwangListItemScecondobj2.GetComponent<quanwangListItemScecond>().userid.text = response.data.ranks[1].uid;
for (int i = 0; i < response.data.ranks[1].level; i++)
{
quanwangListItemScecondobj2.GetComponent<quanwangListItemScecond>().start[i].gameObject.SetActive(true);
}
quanwangListItemScecondobj2.GetComponent<quanwangListItemScecond>().moneynumber.text = response.data.ranks[1].amount.ToString();
quanwangListItemScecondobj2.GetComponent<quanwangListItemScecond>().headicon.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[1].avatar_url);
quanwangListItemTirdobj.GetComponent<quanwangListItemTird>().username.text = response.data.ranks[2].nickname;
quanwangListItemTirdobj.GetComponent<quanwangListItemTird>().username.text = response.data.ranks[2].nickname;
quanwangListItemTirdobj.GetComponent<quanwangListItemTird>().userid.text = response.data.ranks[2].uid;
for (int i = 0; i < response.data.ranks[2].level; i++)
{
quanwangListItemTirdobj.GetComponent<quanwangListItemTird>().start[i].gameObject.SetActive(true);
}
quanwangListItemTirdobj.GetComponent<quanwangListItemTird>().moneynumber.text = response.data.ranks[2].amount.ToString();
quanwangListItemTirdobj.GetComponent<quanwangListItemTird>().headicon.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[2].avatar_url);
}
@ -115,6 +121,7 @@ public class QuanwangPanel : MonoBehaviour
quanwangListItemobj.GetComponent<quanwangListItem>().start[j].gameObject.SetActive(true);
}
quanwangListItemobj.GetComponent<quanwangListItem>().moneynumber.text = response.data.ranks[i].amount.ToString();
quanwangListItemobj.GetComponent<quanwangListItem>().headicon.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(response.data.ranks[i].avatar_url);
}
if (response.data.bottom_show == 1)
@ -128,6 +135,7 @@ public class QuanwangPanel : MonoBehaviour
quanwangSelfListItem.GetComponent<quanwangListItemTird>().start[i].gameObject.SetActive(true);
}
quanwangSelfListItem.GetComponent<quanwangSelfListItem>().moneynumber.text = response.data.bottom_rank.amount.ToString();
quanwangSelfListItem.GetComponent<quanwangSelfListItem>().headicon.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite( response.data.bottom_rank.avatar_url);
}
else
{