138 lines
3.5 KiB
C#
138 lines
3.5 KiB
C#
using Gameplay;
|
|
using PhxhSDK.Res;
|
|
using System.Collections.Generic;
|
|
using Cysharp.Threading.Tasks;
|
|
using UnityEngine;
|
|
using Button = UnityEngine.UI.Button;
|
|
using Framework;
|
|
|
|
public class UI_CampController : UIWindow
|
|
{
|
|
#region UI
|
|
/// <summary>
|
|
/// 返回按钮
|
|
/// </summary>
|
|
private Button buttonBack;
|
|
/// <summary>
|
|
/// 主页按钮
|
|
/// </summary>
|
|
private Button buttonHome;
|
|
/// <summary>
|
|
/// 训练区按钮
|
|
/// </summary>
|
|
private Button buttonTraning;
|
|
/// <summary>
|
|
/// 训练区2按钮
|
|
/// </summary>
|
|
private Button buttonCommunicate;
|
|
/// <summary>
|
|
/// 生活区按钮
|
|
/// </summary>
|
|
private Button buttonLife;
|
|
/// <summary>
|
|
/// 准备按钮
|
|
/// </summary>
|
|
private Button buttonPrepar;
|
|
/// <summary>
|
|
/// 修理区
|
|
/// </summary>
|
|
private Button buttonRepair;
|
|
/// <summary>
|
|
/// 物资存放区
|
|
/// </summary>
|
|
private Button buttonStorage;
|
|
#endregion
|
|
|
|
public override void OnInit()
|
|
{
|
|
buttonBack = GetComponent<Button>("Button_Back/Button_back");
|
|
buttonHome = GetComponent<Button>("Button_Back/Button_Home");
|
|
buttonTraning = GetComponent<Button>("UI_AreaTraning/Button_AreaTraning");
|
|
buttonCommunicate = GetComponent<Button>("UI_AreaCommunicate/Button_AreaCommunicate");
|
|
buttonLife = GetComponent<Button>("UI_AreaLiving/Button_AreaLiving");
|
|
buttonPrepar = GetComponent<Button>("UI_AreaPreparation/Button_AreaPreparation");
|
|
buttonRepair = GetComponent<Button>("UI_AreaRepair/Button_AreaRepair");
|
|
buttonStorage = GetComponent<Button>("UI_AreaStorage/Button_AreaStorage");
|
|
|
|
BindButton(buttonBack, OnClickBack);
|
|
BindButton(buttonHome, OnClickBack);
|
|
BindButton(buttonTraning, OnTraning);
|
|
BindButton(buttonCommunicate, OnCommunicate);
|
|
BindButton(buttonLife, OnLife);
|
|
BindButton(buttonPrepar, OnPrepar);
|
|
BindButton(buttonRepair, OnRepair);
|
|
BindButton(buttonStorage, OnStorage);
|
|
}
|
|
|
|
public override async UniTask<bool> OnBack(object data = null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
#region 回调
|
|
/// <summary>
|
|
/// 点击退出
|
|
/// </summary>
|
|
private async void OnClickBack()
|
|
{
|
|
await CommonUtils.CloseUIWithScene(UINameConst.UI_Camp);
|
|
GameStateManager.Instance.ChangeState(new GameStateMainScene());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 训练区
|
|
/// </summary>
|
|
private async void OnTraning()
|
|
{
|
|
await UI_Camp_SecondController.Open("训练区");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 通讯区
|
|
/// </summary>
|
|
private async void OnCommunicate()
|
|
{
|
|
await UI_Camp_SecondController.Open("通讯区");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 生活区
|
|
/// </summary>
|
|
private async void OnLife()
|
|
{
|
|
await UI_Camp_SecondController.Open("生活区");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 整备区
|
|
/// </summary>
|
|
private async void OnPrepar()
|
|
{
|
|
await UI_Camp_SecondController.Open("整备区");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修理区
|
|
/// </summary>
|
|
private async void OnRepair()
|
|
{
|
|
await UI_Camp_SecondController.Open("修理区");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 物资存放区
|
|
/// </summary>
|
|
private async void OnStorage()
|
|
{
|
|
await UI_Camp_SecondController.Open("物资存放区");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 技能养成
|
|
/// </summary>
|
|
private async void OnSkill()
|
|
{
|
|
await UI_CommandSkillCultivateController.Open();
|
|
}
|
|
#endregion
|
|
} |