167 lines
4.5 KiB
C#
167 lines
4.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.UIElements;
|
|
using Button = UnityEngine.UI.Button;
|
|
using Image = UnityEngine.UI.Image;
|
|
using Toggle = UnityEngine.UI.Toggle;
|
|
using PhxhSDK;
|
|
using Framework;
|
|
using Cysharp.Threading.Tasks;
|
|
using Gameplay;
|
|
using Gameplay.Common;
|
|
|
|
public class UI_VehicleCultivateProController : UIWindow
|
|
{
|
|
#region UI Bind
|
|
|
|
//UI GameObj
|
|
///Auto Gen Start///
|
|
//public Button Button_Back;
|
|
public Button Button_back;
|
|
public TMP_Text Text_Back;
|
|
public Button Button_Home;
|
|
public Image Image_DarkLeft;
|
|
public Image Image_DarkLeftTop;
|
|
public Image Image_DarkTop;
|
|
public Image Image_DarkBottom;
|
|
public Image Image_OrganizatioFlag;
|
|
public Image Image_AngularShape0;
|
|
public TMP_Text Text_VehicleType;
|
|
public Image Image_AngularShape1;
|
|
public TMP_Text Text_Level;
|
|
public Image Image_AngularShape2;
|
|
public TMP_Text Text_Organization;
|
|
public TMP_Text Text_VehicleName;
|
|
public Button Button_Look;
|
|
public Image Image_Attributes;
|
|
public TMP_Text Text_TitleAttri;
|
|
public TMP_Text Text_EnAttri;
|
|
public Image Image_Hp;
|
|
public TMP_Text Text_HpTitle;
|
|
public TMP_Text Text_HpValue;
|
|
public Image Image_Def;
|
|
public TMP_Text Text_DefTitle;
|
|
public TMP_Text Text_DefValue;
|
|
public Image Image_BulletCount;
|
|
public TMP_Text Text_BulletCountTitle;
|
|
public TMP_Text Text_BulletCountValue;
|
|
public Image Image_MemberCount;
|
|
public TMP_Text Text_MemberCountTitle;
|
|
public TMP_Text Text_MemberCountValue;
|
|
public Image Image_Atk;
|
|
public TMP_Text Text_AtkTitle;
|
|
public TMP_Text Text_AtkValue;
|
|
public Image Image_Speed;
|
|
public TMP_Text Text_SpeedTitle;
|
|
public TMP_Text Text_SpeedValue;
|
|
public Image Image_Terrain;
|
|
public TMP_Text Text_TitleTerrain;
|
|
public TMP_Text Text_EnTerrain;
|
|
public Image Image_Ground;
|
|
public TMP_Text Text_GroundTitle;
|
|
public TMP_Text Text_GroundAdapt;
|
|
public Image Image_Snow;
|
|
public TMP_Text Text_SnowTitle;
|
|
public TMP_Text Text_SnowAdapt;
|
|
public Image Image_Mountain;
|
|
public TMP_Text Text_MountainTitle;
|
|
public TMP_Text Text_MountainAdapt;
|
|
public Image Image_Wood;
|
|
public TMP_Text Text_WoodTitle;
|
|
public TMP_Text Text_WoodAdapt;
|
|
public Button Button_Dev;
|
|
public Button Button_Paint;
|
|
public Image Image_VehicleSkill;
|
|
public TMP_Text Text_TitleSkill;
|
|
public TMP_Text Text_SkillName;
|
|
public Image Image_SkillIcon;
|
|
public Image Image_SkillCoolingTimeBg;
|
|
public TMP_Text Text_SkillCoolingTimeValue;
|
|
public TMP_Text Text_ClassTitle;
|
|
public TMP_Text Text_SkillLevel;
|
|
public TMP_Text Text_SkillInfo;
|
|
public Button Button_TechTree;
|
|
public PhxhScrollView ScrollView_VehicleList;
|
|
|
|
///Auto Gen End///
|
|
|
|
#endregion
|
|
|
|
public async static UniTask<UIWindow> Open()
|
|
{
|
|
UIWindow uiWindow = await UIManager.Instance.CreateAndOpenWindow(UINameConst.UI_VehicleCultivatePro);
|
|
CommonUtils.ChangeUIScene(Framework.Constants.UI_VEHICLE_CHOOSE_SCENE_PATH);
|
|
CameraManager.Instance.SetMainCameraActive(true);
|
|
|
|
return uiWindow;
|
|
}
|
|
|
|
// deal with input data
|
|
public override void PreLoad(object data = null)
|
|
{
|
|
|
|
}
|
|
|
|
// Use this for initialization
|
|
public override void OnInit()
|
|
{
|
|
//bind UI GameObj
|
|
UI_VehicleCultivateProBinder.GetComponents(this);
|
|
|
|
var currencyList = GetComponent<UI_CurrencyList>("UI_CurrencyList");
|
|
currencyList.SetData(GLConfig.Inst.data.DiamondItemId, GLConfig.Inst.data.GoldItemId);
|
|
|
|
BindButton(Button_TechTree, OnButton_TreeClick);
|
|
BindButton(Button_back, OnButton_backClick);
|
|
BindButton(Button_Home, OnButton_HomeClick);
|
|
}
|
|
|
|
//invoke when open window
|
|
protected override void OnShowWindow(object data = null)
|
|
{
|
|
var currencyList = GetComponent<UI_CurrencyList>("UI_CurrencyList");
|
|
currencyList.Refresh();
|
|
}
|
|
|
|
//invoke when reload window
|
|
protected override void OnReloadWindow(object data = null)
|
|
{
|
|
|
|
}
|
|
|
|
//invoke when close window
|
|
protected override void OnHideWindow()
|
|
{
|
|
|
|
}
|
|
|
|
//invoke when destroy
|
|
public override void OnRelease()
|
|
{
|
|
base.OnRelease();
|
|
}
|
|
|
|
#region Button Click Event
|
|
public void OnButton_backClick()
|
|
{
|
|
CommonUtils.ChangeUIScene(Framework.Constants.MAIN_SCENE_PATH);
|
|
CloseWindow();
|
|
UIManager.Instance.ShowAllUI();
|
|
}
|
|
|
|
public void OnButton_HomeClick()
|
|
{
|
|
CommonUtils.ChangeUIScene(Framework.Constants.MAIN_SCENE_PATH);
|
|
UIManager.Instance.CloseAllNormalExcept(UINameConst.UI_MainPanel);
|
|
}
|
|
|
|
public void OnButton_TreeClick()
|
|
{
|
|
UI_VehicleTechTreeController.Open().Forget();
|
|
}
|
|
#endregion
|
|
}
|