Cute_demon_attacks/meng_yao/Assets/script/scene_jinshakuang/jskPanel.cs

111 lines
3.9 KiB
C#
Raw Normal View History

2024-11-15 22:44:04 +08:00
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;//<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
public List<Sprite> iconS;
public List<GameObject> lands = new List<GameObject>();
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("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɴ<EFBFBD>ֻ<EFBFBD>߼<EFBFBD>");
jishadao_contorl.canClick = false;
List<BoxType> boxTypes = new List<BoxType>();
int index = 1;
for (int i = 0; i < 5; i++)
{
boxTypes.Add(new BoxType { Name = index.ToString() + "<22>ı<EFBFBD>", prompt = "<22><>" + ArabicToChineseNumberConverter.ConvertToChineseNumbers(index.ToString()) + "<22><>", Type = 4, is_required = true });
2024-12-26 18:02:11 +08:00
boxTypes.Add(new BoxType { Name = "<22><><EFBFBD><EFBFBD>" + index.ToString(), prompt = "<22>ڿ<EFBFBD>" + 1,prompt2 = "<22><><EFBFBD><EFBFBD>"+(i+1),nametext1=<><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"+ (lands[i].GetComponent<roomcontroller>().MaxShipNumber - lands[i].GetComponent<roomcontroller>().shipNumber), Type = 3, goldNumerobj = lands[i].GetComponent<roomcontroller>().ActivateValue.ToString(), icon = iconS[index - 1] });
2024-11-15 22:44:04 +08:00
index++;
}
GameObject gameObject = add_pop_up();
gameObject.GetComponent<input_box_pop_up_window>().minHeight = 800;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸߶<CDB8>
gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(1);//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>ģʽΪ<CABD><CEAA><EFBFBD><EFBFBD>
//gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>ģʽΪ<CABD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "<22><><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD>");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
gameObject.GetComponent<input_box_pop_up_window>().OnEnd += () =>
{
//<2F>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>߼<EFBFBD>
// Cinemachine_2dCon.SetCameraContorl(true);
jishadao_contorl.canClick = true;
};
gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//<2F><>¼ȷ<C2BC><C8B7><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>
{
if (type == 1)
{
2025-01-02 17:12:40 +08:00
if (!Generate1)
2024-11-15 22:44:04 +08:00
{
2024-12-26 18:02:11 +08:00
lands[0].GetComponent<roomcontroller>().BuyActivation();
2024-11-15 22:44:04 +08:00
}
}
});
gameObjects[3].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//<2F><>¼ȷ<C2BC><C8B7><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>
{
if (type == 1)
{
2025-01-02 17:12:40 +08:00
if (!Generate1)
2024-11-15 22:44:04 +08:00
{
2024-12-20 12:03:29 +08:00
lands[1].GetComponent<roomcontroller>().BuyActivation();
2024-11-15 22:44:04 +08:00
}
}
});
gameObjects[5].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//<2F><>¼ȷ<C2BC><C8B7><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>
{
if (type == 1)
{
2025-01-02 17:12:40 +08:00
if (!Generate1)
2024-11-15 22:44:04 +08:00
{
2024-12-20 12:03:29 +08:00
lands[2].GetComponent<roomcontroller>().BuyActivation();
2024-11-15 22:44:04 +08:00
}
}
});
gameObjects[7].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//<2F><>¼ȷ<C2BC><C8B7><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>
{
if (type == 1)
{
2025-01-02 17:12:40 +08:00
if (!Generate1)
2024-11-15 22:44:04 +08:00
{
2024-12-20 12:03:29 +08:00
lands[3].GetComponent<roomcontroller>().BuyActivation();
2024-11-15 22:44:04 +08:00
}
}
});
gameObjects[9].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//<2F><>¼ȷ<C2BC><C8B7><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>
{
if (type == 1)
{
2025-01-02 17:12:40 +08:00
if (!Generate1)
2024-11-15 22:44:04 +08:00
{
2024-12-20 12:03:29 +08:00
lands[4].GetComponent<roomcontroller>().BuyActivation();
2024-11-15 22:44:04 +08:00
}
}
});
}
}