This commit is contained in:
wulongxiao 2024-12-18 20:32:37 +08:00
parent b292efafdd
commit 6649d55ab5
8 changed files with 938 additions and 1430 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,33 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using DG.Tweening; using DG.Tweening;
using Unity.VisualScripting;
public class HeadTanchuang : MonoBehaviour public class HeadTanchuang : MonoBehaviour
{ {
public GameObject AvatarPanel; public GameObject AvatarPanel;
public Button Avatarbtn; public Button Avatarbtn;
public RectTransform AvatarRect; public RectTransform AvatarRect;
Vector3 Deflate = new Vector3(0.5f, 0.5f, 0.5f); Vector3 Deflate = new Vector3(0.5f, 0.5f, 0.5f);
public Transform canvas; public Transform canvas;
private void Awake()
{
}
public Text Name;
public Text Id;
public AssetsPanel _AssetsPanel;
void Start() void Start()
{ {
Avatarbtn.onClick.AddListener(Display_pop_up_window); Avatarbtn.onClick.AddListener(Display_pop_up_window);
AvatarPanel.gameObject.SetActive(false); AvatarPanel.gameObject.SetActive(false);
UpdateShow();
} }
private void Display_pop_up_window() private void Display_pop_up_window()
@ -40,5 +42,11 @@ public class HeadTanchuang : MonoBehaviour
AvatarPanel.gameObject.SetActive(false); AvatarPanel.gameObject.SetActive(false);
} }
async void UpdateShow()
{
await Task.Delay(100);
this.Name.text = _AssetsPanel._PlayerInfoData.nickname.ToString();
this.Id.text = _AssetsPanel._PlayerInfoData.uid.ToString();
}
} }

View File

@ -25,6 +25,10 @@ public class AssetsPanel : MonoBehaviour
public Image UserHead; public Image UserHead;
public Text PersonaText; public Text PersonaText;
public Text PersonID; public Text PersonID;
public PlayerInfoData _PlayerInfoData;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
@ -65,16 +69,11 @@ public class AssetsPanel : MonoBehaviour
async void UpdateTaxt() async void UpdateTaxt()
{ {
PlayerInfoData info=await Scene_main_jiekou.instance.PlayerInfos(); _PlayerInfoData = await Scene_main_jiekou.instance.PlayerInfos();
Stone.text = Scene_main_jiekou.instance.infoData.gem.ToString(); Stone.text = _PlayerInfoData.gem.ToString();
Coin.text = Scene_main_jiekou.instance.infoData.gold.ToString(); Coin.text = _PlayerInfoData.gold.ToString();
Ore.text = Scene_main_jiekou.instance.infoData.water.ToString(); Ore.text = _PlayerInfoData.water.ToString();
Forging.text = Scene_main_jiekou.instance.infoData.forge.ToString(); Forging.text = _PlayerInfoData.forge.ToString();
UserName.text = Scene_main_jiekou.instance.infoData.nickname.ToString();
PersonaText.text = Scene_main_jiekou.instance.infoData.nickname.ToString();
UserID.text = Scene_main_jiekou.instance.infoData.uid.ToString();
PersonID.text = Scene_main_jiekou.instance.infoData.uid.ToString();
} }

View File

@ -7,11 +7,12 @@ public class ReviseName : mount
{ {
public Button ReviseBtn; public Button ReviseBtn;
public Text RevisrText; public Text NameText;
public Text MainnameText; public Text IdText;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
ReviseBtn.onClick.AddListener(ReviseClick); ReviseBtn.onClick.AddListener(ReviseClick);
} }
@ -38,8 +39,8 @@ public class ReviseName : mount
if (issuccefful.code ==200) if (issuccefful.code ==200)
{ {
Promptmgr.Instance.PromptBubble("修改昵称成功"); Promptmgr.Instance.PromptBubble("修改昵称成功");
RevisrText.text = issuccefful.data.nickname; NameText.text = issuccefful.data.nickname;
MainnameText.text = issuccefful.data.nickname; //IdText.text = issuccefful.data.nickname;
gameObject.GetComponent<input_box_pop_up_window>().destroy(); gameObject.GetComponent<input_box_pop_up_window>().destroy();
} }
else else
@ -53,9 +54,10 @@ public class ReviseName : mount
// Update is called once per frame public async void UpdateShow()
void Update()
{ {
PlayerInfoData info = await Scene_main_jiekou.instance.PlayerInfos();
this.NameText.text = info.nickname.ToString();
this.IdText.text = info.uid.ToString();
} }
} }

View File

@ -7,6 +7,7 @@ using UnityEngine;
public class Scene_main_jiekou :MonoBehaviour public class Scene_main_jiekou :MonoBehaviour
{ {
login _Login = new login(); login _Login = new login();
treeInfo TreeInfoss = new treeInfo(); treeInfo TreeInfoss = new treeInfo();
treeTeamData teamData = new treeTeamData(); treeTeamData teamData = new treeTeamData();
treeFansList treeFansList = new treeFansList(); treeFansList treeFansList = new treeFansList();
@ -16,31 +17,34 @@ public class Scene_main_jiekou :MonoBehaviour
cancellation cancellation = new cancellation(); cancellation cancellation = new cancellation();
public static Scene_main_jiekou instance; public static Scene_main_jiekou instance;
public PlayerInfoData infoData;
//public PlayerInfoData infoData;
public bool IsTaskLoging;
BillingStatistics _BillingStatistics = new BillingStatistics(); BillingStatistics _BillingStatistics = new BillingStatistics();
incomeList _incomeList = new incomeList(); incomeList _incomeList = new incomeList();
public void Awake() public async void Awake()
{ {
instance=this; instance=this;
IsTaskLoging = false;
} }
public async void Start()
{
}
public async Task<PlayerInfoData> PlayerInfos() public async Task<PlayerInfoData> PlayerInfos()
{ {
await _Login.TastLogin(); /*if (!IsTaskLoging)
{
IsTaskLoging=true;
}*/
//await _Login.TastLogin();
playerInfo playerInfo=new playerInfo(); playerInfo playerInfo=new playerInfo();
// Debug.Log("balabala"+ MyGlobal.global.loginResponse.Data.access_token);
PlayerIndfo _PlayerIndfo = await playerInfo.PalyerInfo(); PlayerIndfo _PlayerIndfo = await playerInfo.PalyerInfo();
infoData = _PlayerIndfo.Data;
return _PlayerIndfo.Data; return _PlayerIndfo.Data;
} }
@ -93,7 +97,6 @@ public class Scene_main_jiekou :MonoBehaviour
public async Task<billingStatisticsData> GetbillingStatisticsData(int type) public async Task<billingStatisticsData> GetbillingStatisticsData(int type)
{ {
//await _Login.TastLogin(); //await _Login.TastLogin();
billingStatisticsResponse info = await _BillingStatistics.billingStatistics(type); billingStatisticsResponse info = await _BillingStatistics.billingStatistics(type);
return info.Data; return info.Data;
} }

View File

@ -29,7 +29,7 @@ public class miner_jiekou : MonoBehaviour
/// <returns></returns> /// <returns></returns>
public async Task<List<MinngConfigData>> GetMinerInfo(int index) public async Task<List<MinngConfigData>> GetMinerInfo(int index)
{ {
// await _Login.TastLogin(); await _Login.TastLogin();
miningActivate go = new miningActivate(); miningActivate go = new miningActivate();
MiningConfigResponse info= await go.MiningConfig(index); MiningConfigResponse info= await go.MiningConfig(index);

View File

@ -8,6 +8,8 @@ public class login : MonoBehaviour
{ {
public string token; public string token;
checkAccount checkAccount = new checkAccount(); checkAccount checkAccount = new checkAccount();
//private bool isTast;
// 创建请求头,使用最新的 token // 创建请求头,使用最新的 token
public Dictionary<string, string> CreateHeadersTologin() public Dictionary<string, string> CreateHeadersTologin()
{ {