39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
public class KuangChangPop : MonoBehaviour
|
|
{
|
|
queryMiningContractList101 queryMiningContractList = new queryMiningContractList101();//10.110.1,查询可购买的挖矿合约
|
|
MiningContractList miningContractList = new MiningContractList();
|
|
public GameObject ItemParent;
|
|
public GameObject kuanghcangItem;
|
|
// Start is called before the first frame update
|
|
async void Start()
|
|
{
|
|
//查询可购买的挖矿合约
|
|
miningContractList = await queryMiningContractList.QueryMiningContract();
|
|
Debug.Log(miningContractList.data.Count);
|
|
for (int i = miningContractList.data.Count -1; i >= 0; i--)
|
|
{
|
|
var miningContract = miningContractList.data[i];
|
|
GameObject item = Instantiate(kuanghcangItem);
|
|
item.transform.parent = ItemParent.transform;
|
|
NewkuangchangItem newiItem = item.GetComponent<NewkuangchangItem>();
|
|
newiItem.count.text = miningContract.voluteCoinBuy.ToString();//显示每一个合约的购买所需赋值
|
|
newiItem.miningContract = miningContractList.data[i];//给每一个合约赋值
|
|
}
|
|
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|