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 });
|
|
|
|
|
boxTypes.Add(new BoxType { Name = "<22><><EFBFBD><EFBFBD>" + index.ToString(), prompt = "<22><><EFBFBD><EFBFBD>" + 1, Type = 3, goldNumerobj = (200 * index).ToString(), icon = iconS[index - 1] });
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
if (!Generate1 && (PlayerManager.Instance.Coins - 200) > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
lands[0].GetComponent<roomcontroller>().add_fish();
|
|
|
|
|
PlayerManager.Instance.SetMoney(MoneyType.Coins, -200);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
if (!Generate1 && (PlayerManager.Instance.Coins - 400) > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
lands[1].GetComponent<roomcontroller>().add_fish();
|
|
|
|
|
PlayerManager.Instance.SetMoney(MoneyType.Coins, -400);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
if (!Generate1 && (PlayerManager.Instance.Coins - 600) > 0)
|
|
|
|
|
{
|
|
|
|
|
lands[2].GetComponent<roomcontroller>().add_fish();
|
|
|
|
|
PlayerManager.Instance.SetMoney(MoneyType.Coins, -600);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
if (!Generate1 && (PlayerManager.Instance.Coins - 600) > 0)
|
|
|
|
|
{
|
2024-11-16 01:20:28 +08:00
|
|
|
|
lands[3].GetComponent<roomcontroller>().add_fish();
|
2024-11-15 22:44:04 +08:00
|
|
|
|
PlayerManager.Instance.SetMoney(MoneyType.Coins, -600);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
if (!Generate1 && (PlayerManager.Instance.Coins - 600) > 0)
|
|
|
|
|
{
|
2024-11-16 01:20:28 +08:00
|
|
|
|
lands[4].GetComponent<roomcontroller>().add_fish();
|
2024-11-15 22:44:04 +08:00
|
|
|
|
PlayerManager.Instance.SetMoney(MoneyType.Coins, -600);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|