using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class jskPanel : mount { public static jskPanel instance; public delegate void OnClikeWT(int type, int num); public event OnClikeWT OnType;//点击事件 public List iconS; public List lands = new List(); public bool Generate1 = false; public bool Generate2 = false; public bool Generate3 = false; public override void Awake() { instance = this; } public async void buy_ship() { // Cinemachine_2dCon.SetCameraContorl(false); //Debug.LogError("禁用生成船只逻辑"); jishadao_contorl.canClick = false; List boxTypes = new List(); int index = 1; for (int i = 0; i < 5; i++) { boxTypes.Add(new BoxType { Name = index.ToString() + "文本", prompt = "第" + ArabicToChineseNumberConverter.ConvertToChineseNumbers(index.ToString()) + "层", Type = 4, is_required = true }); boxTypes.Add(new BoxType { Name = "捕鱼" + index.ToString(), prompt = "挖矿" + 1,prompt2 = "矿工"+(i+1),nametext1="剩余数量:"+ (lands[i].GetComponent().MaxShipNumber - lands[i].GetComponent().shipNumber), Type = 3, goldNumerobj = lands[i].GetComponent().ActivateValue.ToString(), icon = iconS[index - 1] }); index++; } GameObject gameObject = add_pop_up(); gameObject.GetComponent().minHeight = 800;//设置最低高度 gameObject.GetComponent().setScrollMode(1);//设置滚动模式为滚动 //gameObject.GetComponent().setScrollMode(0);//设置滚动模式为自动填充 List gameObjects = gameObject.GetComponent().updateUI(boxTypes, "购买人才");//测试输入框回调处理 gameObject.GetComponent().OnEnd += () => { //关闭摄像头逻辑 // Cinemachine_2dCon.SetCameraContorl(true); jishadao_contorl.canClick = true; }; gameObjects[1].GetComponent().register_click(async (BoxType boxType, int type) =>//登录确定或取消 { if (type == 1) { if (!Generate1 && (PlayerManager.Instance.Coins - 200) > 0) { lands[0].GetComponent().BuyActivation(); } } }); gameObjects[3].GetComponent().register_click(async (BoxType boxType, int type) =>//登录确定或取消 { if (type == 1) { if (!Generate1 && (PlayerManager.Instance.Coins - 400) > 0) { lands[1].GetComponent().BuyActivation(); } } }); gameObjects[5].GetComponent().register_click(async (BoxType boxType, int type) =>//登录确定或取消 { if (type == 1) { if (!Generate1 && (PlayerManager.Instance.Coins - 600) > 0) { lands[2].GetComponent().BuyActivation(); } } }); gameObjects[7].GetComponent().register_click(async (BoxType boxType, int type) =>//登录确定或取消 { if (type == 1) { if (!Generate1 && (PlayerManager.Instance.Coins - 600) > 0) { lands[3].GetComponent().BuyActivation(); } } }); gameObjects[9].GetComponent().register_click(async (BoxType boxType, int type) =>//登录确定或取消 { if (type == 1) { if (!Generate1 && (PlayerManager.Instance.Coins - 600) > 0) { lands[4].GetComponent().BuyActivation(); } } }); } }