_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/LqUiScripts/PerSonalCenterPanel.cs

66 lines
2.0 KiB
C#
Raw Normal View History

2024-11-26 00:40:56 +08:00
using Newtonsoft.Json;
2024-11-25 20:50:33 +08:00
using System.Collections;
using System.Collections.Generic;
2024-11-26 00:40:56 +08:00
using System.Threading.Tasks;
2024-11-25 20:50:33 +08:00
using UnityEngine;
2024-11-25 22:18:57 +08:00
using UnityEngine.UI;
2024-11-25 20:50:33 +08:00
public class PerSonalCenterPanel : MonoBehaviour
{
2024-11-25 22:18:57 +08:00
public Button invitefriendsBtn;
public GameObject invitefriendsPanel;
public GameObject editPanel;
2024-11-26 00:40:56 +08:00
public UserInfomation14 userInfomation14;
public Text nickName;
2024-11-25 20:50:33 +08:00
// Start is called before the first frame update
void Start()
{
2024-11-26 00:40:56 +08:00
GetPlayerInfo();
2024-11-25 20:50:33 +08:00
}
// Update is called once per frame
void Update()
{
2024-11-26 00:40:56 +08:00
}
void SetPlayerName()
{
2024-11-25 20:50:33 +08:00
}
2024-11-25 22:18:57 +08:00
public void SetInviteFriendsPanel()
{
invitefriendsPanel.gameObject.SetActive(true);
transform.gameObject.SetActive(false);
}
public void SetEditPanel()
{
editPanel.gameObject.SetActive(true);
}
public void SetPerSonalCenterPanel()
{
transform.gameObject.SetActive(false);
}
2024-11-26 00:40:56 +08:00
public async Task GetPlayerInfo() // 1.4
{
// ׼<><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD>
Dictionary<string, string> head14 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// <20><EFBFBD><ECB2BD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
string response14 = await web.SendRequest(web.URL + "/snail/user/queryUserInfo", "POST", "{}", head14);
Debug.Log("1.4<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ" + response14);
userInfomation14 = JsonConvert.DeserializeObject<UserInfomation14>(response14);
Debug.Log("<22><><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>" + userInfomation14.data.beansCoin);
//Money = userInfomation14.beansCoin;
Debug.Log("&&&&&&&&&&&&&&&&&&&&7" + userInfomation14.data.nickName);
nickName.text = userInfomation14.data.nickName;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
Global.global.response = JsonConvert.DeserializeObject<ServerResponse>(response14);
// <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
await Task.CompletedTask; // <20><><EFBFBD><EFBFBD>ֱ<EFBFBD>ӷ<EFBFBD><D3B7>أ<EFBFBD><D8A3><EFBFBD>ʹ<EFBFBD><CAB9> await
}
2024-11-25 20:50:33 +08:00
}