2024-11-28 05:10:50 +08:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class BagPanel : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public GameObject woniuConnect;
|
|
|
|
|
public GameObject wokeConnect;
|
|
|
|
|
|
|
|
|
|
public GameObject woniuSc;
|
|
|
|
|
public GameObject wokeSc;
|
|
|
|
|
|
|
|
|
|
public Button woniuBtn;
|
|
|
|
|
public Button wokeBtn;
|
|
|
|
|
public GameObject Musk;
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
woniuBtn.onClick.AddListener(WoniuClick);
|
|
|
|
|
wokeBtn.onClick.AddListener(WokeClick);
|
|
|
|
|
Init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async void Init()
|
|
|
|
|
{
|
|
|
|
|
string response = "";//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
response = await web.SendRequest(web.URL + "/snail/user/queryUserBag", "POST","{}", Global.global.CreateHeaders());
|
|
|
|
|
Debug.Log(response);
|
2024-12-09 19:52:33 +08:00
|
|
|
|
bag111 serverRespon111 = JsonConvert.DeserializeObject<bag111>(response);
|
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD>================================"+serverRespon111.data.slotCount);
|
|
|
|
|
for (int i = 0; i < serverRespon111.data.snailCount; i++)
|
2024-11-28 05:10:50 +08:00
|
|
|
|
{
|
|
|
|
|
GameObject woniuitem = (GameObject)Instantiate(Resources.Load("LLPrefabs/items"),woniuConnect.transform);
|
2024-12-09 19:52:33 +08:00
|
|
|
|
Debug.Log(1);
|
2024-11-28 05:10:50 +08:00
|
|
|
|
}
|
2024-12-09 19:52:33 +08:00
|
|
|
|
for (int i = 0; i < serverRespon111.data.slotCount; i++)
|
2024-11-28 05:10:50 +08:00
|
|
|
|
{
|
|
|
|
|
GameObject wokeitem = (GameObject)Instantiate(Resources.Load("LLPrefabs/items"),wokeConnect.transform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wokeSc.gameObject.SetActive(false);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WoniuClick()
|
|
|
|
|
{
|
|
|
|
|
woniuBtn.transform.SetParent(this.transform);
|
|
|
|
|
wokeBtn.transform.SetParent(Musk.transform);
|
|
|
|
|
woniuSc.gameObject.SetActive(true);
|
|
|
|
|
wokeSc.gameObject.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WokeClick()
|
|
|
|
|
{
|
|
|
|
|
woniuBtn.transform.SetParent(Musk.transform);
|
|
|
|
|
wokeBtn.transform.SetParent(this.transform);
|
|
|
|
|
woniuSc.gameObject.SetActive(false);
|
|
|
|
|
wokeSc.gameObject.SetActive(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|