个人中心UI修改
This commit is contained in:
parent
210351bef2
commit
d28c6a4f82
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@ public class FriendInfo : MonoBehaviour
|
||||
public Text phonrNumberTxt;
|
||||
public Text timeTxt;
|
||||
public GameObject sharePanel;
|
||||
public GameObject friendPanel;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
@ -23,6 +24,6 @@ public class FriendInfo : MonoBehaviour
|
||||
public void SetSharePanel()
|
||||
{
|
||||
sharePanel.gameObject.SetActive(true);
|
||||
transform.gameObject.SetActive(false);
|
||||
friendPanel.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ public class InviteFriendsPanel : MonoBehaviour
|
||||
public void SetInviteFriendPanel()
|
||||
{
|
||||
invitefriendPanel.gameObject.SetActive(true);
|
||||
transform.gameObject.SetActive(false);
|
||||
}
|
||||
public void SetInviteFriendsPanel()
|
||||
{
|
||||
|
@ -1,5 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@ -8,16 +10,22 @@ public class PerSonalCenterPanel : MonoBehaviour
|
||||
public Button invitefriendsBtn;
|
||||
public GameObject invitefriendsPanel;
|
||||
public GameObject editPanel;
|
||||
public UserInfomation14 userInfomation14;
|
||||
public Text nickName;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
GetPlayerInfo();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
void SetPlayerName()
|
||||
{
|
||||
|
||||
}
|
||||
public void SetInviteFriendsPanel()
|
||||
{
|
||||
@ -32,4 +40,26 @@ public class PerSonalCenterPanel : MonoBehaviour
|
||||
{
|
||||
transform.gameObject.SetActive(false);
|
||||
}
|
||||
public async Task GetPlayerInfo() // 1.4
|
||||
{
|
||||
// 准备请求的头部信息,包含授权令牌
|
||||
Dictionary<string, string> head14 = new Dictionary<string, string>
|
||||
{
|
||||
{ "Authorization", Global.global.serverResponse.data.token }
|
||||
};
|
||||
|
||||
// 异步查询玩家信息
|
||||
string response14 = await web.SendRequest(web.URL + "/snail/user/queryUserInfo", "POST", "{}", head14);
|
||||
Debug.Log("1.4查询玩家信息" + response14);
|
||||
userInfomation14 = JsonConvert.DeserializeObject<UserInfomation14>(response14);
|
||||
Debug.Log("玩家剩余蜗蛋:" + userInfomation14.data.beansCoin);
|
||||
//Money = userInfomation14.beansCoin;
|
||||
Debug.Log("&&&&&&&&&&&&&&&&&&&&7" + userInfomation14.data.nickName);
|
||||
nickName.text = userInfomation14.data.nickName;
|
||||
// 解析服务器返回的数据
|
||||
Global.global.response = JsonConvert.DeserializeObject<ServerResponse>(response14);
|
||||
|
||||
// 不需要返回值,只需表示异步操作完成
|
||||
await Task.CompletedTask; // 或者直接返回,不使用 await
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user