_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Scene_main/Scene_main_jiekou.cs

75 lines
1.8 KiB
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
public class Scene_main_jiekou :Base
{
public static Scene_main_jiekou instance;
public mainBTN _mainBTN;
2024-11-27 22:22:41 +08:00
//<2F>û<EFBFBD><C3BB><EFBFBD>Ϣ
private RealPlayerInfo _realPlayerInfo;//<2F>û<EFBFBD><C3BB><EFBFBD>Ϣ<EFBFBD><EFBFBD><E1B9B9>
private queryPlayerInfo _queryPlayerInfo;//<2F>û<EFBFBD><C3BB><EFBFBD>Ϣ
//<2F>̳<EFBFBD><CCB3><EFBFBD>Ϣ
2024-11-27 23:22:34 +08:00
private MallResponsePro _mallResponsePro;//<2F>̳<EFBFBD><CCB3>б<EFBFBD><D0B1><EFBFBD><E1B9B9>
2024-11-27 22:22:41 +08:00
private getMallList21 _getMallList21;//<2F>̳<EFBFBD><CCB3>б<EFBFBD><D0B1><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
2024-11-27 23:22:34 +08:00
//<2F>̳<EFBFBD>info<66>ֵ<EFBFBD>
public Dictionary<int, ProductPro> shopItemDic;
// Start is called before the first frame update
private void Awake()
{
instance = this;
2024-11-27 22:22:41 +08:00
2024-11-27 22:29:31 +08:00
//testLogo();
2024-11-27 23:22:34 +08:00
//getPlayerInfo();
2024-11-27 22:22:41 +08:00
// getShopInfo();
}
2024-11-27 22:22:41 +08:00
async void getPlayerInfo()
{
2024-11-27 22:22:41 +08:00
await PlayerInfoAsync();
/*Debug.Log(_realPlayerInfo.data.nickName);
Debug.Log(_realPlayerInfo.data.voluteCoin);
2024-11-27 22:22:41 +08:00
Debug.Log(_realPlayerInfo.data.beansCoin);*/
_mainBTN.UpDatePlayer(_realPlayerInfo.data.nickName, _realPlayerInfo.data.voluteCoin.ToString("f1") + "M", _realPlayerInfo.data.beansCoin.ToString("f1") + "M");
}
2024-11-27 22:22:41 +08:00
async Task PlayerInfoAsync()
{
2024-11-27 22:22:41 +08:00
_realPlayerInfo = new RealPlayerInfo();
_queryPlayerInfo = new queryPlayerInfo();
_realPlayerInfo = await _queryPlayerInfo.QueryPlayerInfoPro();
}
2024-11-27 22:22:41 +08:00
2024-11-27 23:22:34 +08:00
2024-11-27 22:22:41 +08:00
public async Task ShopInfo()
{
2024-11-27 23:22:34 +08:00
//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>
shopItemDic = null;
_mallResponsePro = null;
_getMallList21 = null;
//<2F><>дд<D0B4><D0B4>
2024-11-27 22:22:41 +08:00
_mallResponsePro = new MallResponsePro();
_getMallList21 = new getMallList21();
_mallResponsePro = await _getMallList21.getMallList(1, 1, 20);
2024-11-27 23:22:34 +08:00
foreach (ProductPro go in _mallResponsePro.Data.DataList)
{
shopItemDic.Add(go.ProductId,go);
}
2024-11-27 22:22:41 +08:00
}
}