2025-04-15 16:46:42 +08:00
|
|
|
|
using cfg.SkillCfg;
|
|
|
|
|
|
using cfg.VihecleCultivateCfg;
|
|
|
|
|
|
using Cysharp.Threading.Tasks;
|
|
|
|
|
|
using DG.Tweening;
|
|
|
|
|
|
using Framework;
|
|
|
|
|
|
using Gameplay;
|
|
|
|
|
|
using Gameplay.Net;
|
|
|
|
|
|
using PhxhSDK;
|
|
|
|
|
|
using System;
|
2024-12-16 14:07:41 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using TMPro;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using Button = UnityEngine.UI.Button;
|
|
|
|
|
|
using Image = UnityEngine.UI.Image;
|
|
|
|
|
|
|
|
|
|
|
|
public class UI_VehiclePartTreeDetailController : UIWindow
|
|
|
|
|
|
{
|
|
|
|
|
|
#region UI
|
|
|
|
|
|
//UI GameObj
|
|
|
|
|
|
///Auto Gen Start///
|
2024-12-17 15:00:40 +08:00
|
|
|
|
public Image Image_Bg;
|
2024-12-16 14:07:41 +08:00
|
|
|
|
public TMP_Text Text_Name;
|
|
|
|
|
|
public Button Button_Check;
|
|
|
|
|
|
public Image Image_Attributes;
|
|
|
|
|
|
public TMP_Text Text_AttributesTitle;
|
|
|
|
|
|
public Image Image_UpSign_Hp;
|
|
|
|
|
|
public Image Image_UpBg_Hp;
|
|
|
|
|
|
public TMP_Text Text_Title_Hp;
|
|
|
|
|
|
public TMP_Text Text_UpTitle_Hp;
|
|
|
|
|
|
public TMP_Text Text_Value_Hp;
|
|
|
|
|
|
public Image Image_UpSign_MemberCount;
|
|
|
|
|
|
public Image Image_UpBg_MemberCount;
|
|
|
|
|
|
public TMP_Text Text_Title_MemberCount;
|
|
|
|
|
|
public TMP_Text Text_UpTitle_MemberCount;
|
|
|
|
|
|
public TMP_Text Text_Value_MemberCount;
|
|
|
|
|
|
public Image Image_UpSign_Def;
|
|
|
|
|
|
public Image Image_UpBg_Def;
|
|
|
|
|
|
public TMP_Text Text_Title_Def;
|
|
|
|
|
|
public TMP_Text Text_UpTitle_Def;
|
|
|
|
|
|
public TMP_Text Text_Value_Def;
|
|
|
|
|
|
public Image Image_UpSign_Atk;
|
|
|
|
|
|
public Image Image_UpBg_Atk;
|
|
|
|
|
|
public TMP_Text Text_Title_Atk;
|
|
|
|
|
|
public TMP_Text Text_UpTitle_Atk;
|
|
|
|
|
|
public TMP_Text Text_Value_Atk;
|
|
|
|
|
|
public Image Image_UpSign_BulletCount;
|
|
|
|
|
|
public Image Image_UpBg_BulletCount;
|
|
|
|
|
|
public TMP_Text Text_Title_BulletCount;
|
|
|
|
|
|
public TMP_Text Text_UpTitle_BulletCount;
|
|
|
|
|
|
public TMP_Text Text_Value_BulletCount;
|
|
|
|
|
|
public Image Image_UpSign_Speed;
|
|
|
|
|
|
public Image Image_UpBg_Speed;
|
|
|
|
|
|
public TMP_Text Text_Title_Speed;
|
|
|
|
|
|
public TMP_Text Text_UpTitle_Speed;
|
|
|
|
|
|
public TMP_Text Text_Value_Speed;
|
|
|
|
|
|
public Image Image_Terrain;
|
|
|
|
|
|
public TMP_Text Text_TerrainTitle;
|
|
|
|
|
|
public TMP_Text Text_Title_Ground;
|
|
|
|
|
|
public TMP_Text Text_Value_Ground;
|
|
|
|
|
|
public TMP_Text Text_Title_Mountain;
|
|
|
|
|
|
public TMP_Text Text_Value_Mountain;
|
|
|
|
|
|
public TMP_Text Text_Title_Snow;
|
|
|
|
|
|
public TMP_Text Text_Value_Snow;
|
|
|
|
|
|
public TMP_Text Text_Title_Wood;
|
|
|
|
|
|
public TMP_Text Text_Value_Wood;
|
|
|
|
|
|
public Image Image_SkillBg;
|
|
|
|
|
|
public Image Image_VehicleSkill;
|
|
|
|
|
|
public TMP_Text Text_TitleSkill;
|
|
|
|
|
|
public TMP_Text Text_SkillName;
|
|
|
|
|
|
public TMP_Text Text_ClassTitle;
|
|
|
|
|
|
public TMP_Text Text_SkillLevel;
|
|
|
|
|
|
public Image Image_SkillIcon;
|
|
|
|
|
|
public Image Image_SkillCoolingTimeBg;
|
|
|
|
|
|
public TMP_Text Text_SkillCoolingTimeValue;
|
|
|
|
|
|
public TMP_Text Text_SkillInfo;
|
2024-12-17 15:00:40 +08:00
|
|
|
|
public Button Button_Equipment;
|
2025-02-12 17:25:08 +08:00
|
|
|
|
public Button Button_Enter;
|
2024-12-16 14:07:41 +08:00
|
|
|
|
|
2025-04-15 16:46:42 +08:00
|
|
|
|
///Auto Gen End///
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 升级材料
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private class Materal : UIGameObjectWrapper
|
|
|
|
|
|
{
|
|
|
|
|
|
private TMP_Text textValue;
|
|
|
|
|
|
private GameObject goRed;
|
|
|
|
|
|
private GameObject goGreen;
|
|
|
|
|
|
|
|
|
|
|
|
private GenericItem genericItem;
|
|
|
|
|
|
|
|
|
|
|
|
public Materal(GameObject root) : base(root)
|
|
|
|
|
|
{
|
|
|
|
|
|
textValue = GetComponent<TMP_Text>("value");
|
|
|
|
|
|
goRed = FindObj("Image_Red");
|
|
|
|
|
|
goGreen = FindObj("Image_Green02");
|
|
|
|
|
|
|
|
|
|
|
|
genericItem = new(FindObj("item/GenericItem"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetInfo(int itemId, int count)
|
|
|
|
|
|
{
|
|
|
|
|
|
textValue.text = $"{Actor.Instance.Item.GetItemCount(itemId)}/{count}";
|
|
|
|
|
|
goRed.IsScaleShow(!(Actor.Instance.Item.GetItemCount(itemId) >= count));
|
|
|
|
|
|
goGreen.IsScaleShow(Actor.Instance.Item.GetItemCount(itemId) >= count);
|
|
|
|
|
|
|
2025-04-15 17:08:15 +08:00
|
|
|
|
genericItem.SetInfo(itemId, 0, () => UI_UsingItemController.Open(itemId, () =>
|
|
|
|
|
|
{
|
|
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UI_VehiclePartTreeDetail);
|
|
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UI_VehiclePartTree);
|
|
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UI_VehicleTechTree);
|
|
|
|
|
|
CommonUtils.ChangeUIScene(Framework.Constants.MAIN_SCENE_PATH);
|
|
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UI_VehicleCultivatePro);
|
|
|
|
|
|
}));
|
2025-04-15 16:46:42 +08:00
|
|
|
|
|
|
|
|
|
|
IsScaleShow = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void Dispose(bool isDisposing)
|
|
|
|
|
|
{
|
|
|
|
|
|
genericItem.Dispose();
|
|
|
|
|
|
|
|
|
|
|
|
base.Dispose(isDisposing);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-12-16 14:07:41 +08:00
|
|
|
|
|
2025-04-15 16:46:42 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 升级材料列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly List<Materal> listMateral = new(2);
|
|
|
|
|
|
private long ID;
|
2025-02-12 17:25:08 +08:00
|
|
|
|
private Action EnterPartTree;
|
2024-12-30 16:13:58 +08:00
|
|
|
|
private Action m_ReleaseCallback;
|
2024-12-17 13:26:31 +08:00
|
|
|
|
|
2024-12-18 19:58:14 +08:00
|
|
|
|
class InitData
|
2024-12-16 14:07:41 +08:00
|
|
|
|
{
|
2024-12-18 19:58:14 +08:00
|
|
|
|
public long ID;
|
2025-02-12 17:25:08 +08:00
|
|
|
|
public Action EnterPartTree;
|
2024-12-30 16:13:58 +08:00
|
|
|
|
public Action callback;
|
2024-12-18 19:58:14 +08:00
|
|
|
|
|
2025-02-12 17:25:08 +08:00
|
|
|
|
public InitData(long id, Action enterPartTree,Action onReleaseCallback)
|
2024-12-18 19:58:14 +08:00
|
|
|
|
{
|
|
|
|
|
|
ID = id;
|
|
|
|
|
|
EnterPartTree = enterPartTree;
|
2024-12-30 16:13:58 +08:00
|
|
|
|
callback = onReleaseCallback;
|
2024-12-18 19:58:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-02-12 17:25:08 +08:00
|
|
|
|
public async static UniTask<UIWindow> Open(long TreeNodeID, Action EnterPartTree = null, Action OnReleaseCallback = null)
|
2024-12-18 19:58:14 +08:00
|
|
|
|
{
|
2024-12-30 16:13:58 +08:00
|
|
|
|
var initdata = new InitData(TreeNodeID, EnterPartTree, OnReleaseCallback);
|
2024-12-18 19:58:14 +08:00
|
|
|
|
return await UIManager.Instance.CreateAndOpenWindow(UINameConst.UI_VehiclePartTreeDetail, initdata);
|
2024-12-16 14:07:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-17 13:26:31 +08:00
|
|
|
|
// deal with input data
|
|
|
|
|
|
public override void PreLoad(object data = null)
|
|
|
|
|
|
{
|
2024-12-18 19:58:14 +08:00
|
|
|
|
var input = data as InitData;
|
|
|
|
|
|
ID = input.ID;
|
2025-02-12 17:25:08 +08:00
|
|
|
|
EnterPartTree = input.EnterPartTree;
|
2024-12-30 16:13:58 +08:00
|
|
|
|
m_ReleaseCallback = input.callback;
|
2024-12-16 14:07:41 +08:00
|
|
|
|
DebugUtil.Log("Vehicle Part Tree Detail ID: " + ID);
|
2024-12-17 13:26:31 +08:00
|
|
|
|
}
|
2024-12-18 14:39:01 +08:00
|
|
|
|
|
2024-12-16 14:07:41 +08:00
|
|
|
|
// Use this for initialization
|
|
|
|
|
|
public override void OnInit()
|
|
|
|
|
|
{
|
|
|
|
|
|
//bind UI GameObj
|
|
|
|
|
|
UI_VehiclePartTreeDetailBinder.GetComponents(this);
|
|
|
|
|
|
|
2024-12-18 19:58:14 +08:00
|
|
|
|
BindButton(Button_Check, OnCheckButtonClick);
|
2024-12-18 14:39:01 +08:00
|
|
|
|
|
2025-02-06 15:18:27 +08:00
|
|
|
|
var BgClose = GetComponent<RaycastDetect>("Bg__Close");
|
|
|
|
|
|
BgClose.ClickAction = () =>
|
|
|
|
|
|
{
|
|
|
|
|
|
OnSwitchAnim(false, () =>
|
|
|
|
|
|
{
|
|
|
|
|
|
CloseWindow();
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
BgClose.DefaultAction = () => CloseWindow();
|
|
|
|
|
|
|
2024-12-18 19:58:14 +08:00
|
|
|
|
bool canUpgrade = false; // = Actor.Instance.Character.GetVehicleDevelopment(ID);
|
2024-12-25 12:40:51 +08:00
|
|
|
|
VehicleCultivateData vehicleData;
|
2024-12-18 14:39:01 +08:00
|
|
|
|
var node = VehicleCultivateManager.Instance.Get(ID);
|
|
|
|
|
|
if (node is VehicleTreeNode vehicle)
|
|
|
|
|
|
{
|
|
|
|
|
|
Text_Name.text = VehicleDataHelper.GetVehicleLocalizeName((int)ID);
|
2024-12-25 12:40:51 +08:00
|
|
|
|
vehicleData = VehicleCultivateDataManager.Instance.GetVehicleCultivateData(ID);
|
2024-12-18 14:39:01 +08:00
|
|
|
|
if(vehicleData == null)
|
|
|
|
|
|
{
|
2024-12-25 12:40:51 +08:00
|
|
|
|
vehicleData = new VehicleCultivateData((int)ID);
|
2024-12-18 14:39:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
SetVehicleData(vehicleData);
|
|
|
|
|
|
|
|
|
|
|
|
canUpgrade = Actor.Instance.Character.GetVehicleDevelopment(ID) == null;
|
2024-12-18 19:58:14 +08:00
|
|
|
|
|
|
|
|
|
|
if (TableManager.Instance.Tables.VehicleConfig.Get((int)ID).UnlockType == UnlockType.Buy)
|
|
|
|
|
|
{
|
2025-02-06 15:18:27 +08:00
|
|
|
|
DebugUtil.LogWarning("这里需要配置本地化");
|
2024-12-18 19:58:14 +08:00
|
|
|
|
Button_Equipment.GetComponentInChildren<TMP_Text>().text = "直购";
|
|
|
|
|
|
}
|
2024-12-18 14:39:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
else if (node is VehicleComponentTreeNode comp)
|
|
|
|
|
|
{
|
|
|
|
|
|
var compCfg = TableManager.Instance.Tables.VehicleComponent.Get(ID);
|
2025-02-27 15:57:27 +08:00
|
|
|
|
Text_Name.text = CommonUtils.GetLocalizeText("Vehicle_CompName_" + ID);
|
2024-12-18 14:39:01 +08:00
|
|
|
|
|
|
|
|
|
|
var vehicleID = compCfg.VehicleID;
|
2024-12-25 12:40:51 +08:00
|
|
|
|
vehicleData = VehicleCultivateDataManager.Instance.GetVehicleCultivateData(vehicleID);
|
2024-12-18 14:39:01 +08:00
|
|
|
|
if (vehicleData == null)
|
|
|
|
|
|
{
|
2024-12-25 12:40:51 +08:00
|
|
|
|
vehicleData = new VehicleCultivateData(vehicleID);
|
2024-12-18 14:39:01 +08:00
|
|
|
|
}
|
2024-12-18 19:58:14 +08:00
|
|
|
|
if (vehicleData.UpgradedComponents.Contains((uint)ID))//组件已经强化
|
2024-12-18 14:39:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
SetVehicleData(vehicleData);
|
|
|
|
|
|
canUpgrade = false;
|
|
|
|
|
|
}
|
2024-12-18 19:58:14 +08:00
|
|
|
|
else//组件未强化,显示提升数值
|
2024-12-18 14:39:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
SetVehicleData(vehicleData, compCfg);
|
|
|
|
|
|
canUpgrade = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//canUpgrade = Actor.Instance.Character.GetVehicleDevelopment(vehicleID);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-02-12 17:25:08 +08:00
|
|
|
|
if (!canUpgrade || EnterPartTree != null)
|
2024-12-17 15:00:40 +08:00
|
|
|
|
{
|
|
|
|
|
|
Button_Equipment.gameObject.SetActive(false);
|
|
|
|
|
|
}
|
2025-02-12 17:51:33 +08:00
|
|
|
|
if (EnterPartTree == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Button_Enter.gameObject.SetActive(false);
|
|
|
|
|
|
}
|
2024-12-17 15:00:40 +08:00
|
|
|
|
BindButton(Button_Equipment, OnUpgradeClick);
|
2025-02-12 17:25:08 +08:00
|
|
|
|
BindButton(Button_Enter, OnEnterPartTreeClick);
|
2025-04-15 16:46:42 +08:00
|
|
|
|
SetMaterials();
|
2024-12-17 15:00:40 +08:00
|
|
|
|
|
2024-12-16 14:07:41 +08:00
|
|
|
|
Image_Bg.GetComponent<RectTransform>().pivot = new Vector2(0, 0.5f);
|
|
|
|
|
|
OnSwitchAnim(true);
|
2025-02-06 15:18:27 +08:00
|
|
|
|
|
2024-12-16 14:07:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-15 16:46:42 +08:00
|
|
|
|
|
|
|
|
|
|
void SetMaterials()
|
|
|
|
|
|
{
|
|
|
|
|
|
Transform tsMateralRoot = Button_Equipment.transform.Find("VehicleUpgrade");
|
|
|
|
|
|
if (tsMateralRoot == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("VehicleUpgrade not found");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
for (int i = 0; i < tsMateralRoot.childCount; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
listMateral.Add(new Materal(tsMateralRoot.GetChild(i).gameObject));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var items = VehicleCultivateManager.Instance.Get(ID).GetUpgradeCost();
|
|
|
|
|
|
for (int i = 0; i < listMateral.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
Materal materal = listMateral[i];
|
|
|
|
|
|
|
|
|
|
|
|
if ((i + 1) <= items.Ids.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
materal.SetInfo((int)items.Ids[i], (int)items.Counts[i]);
|
|
|
|
|
|
materal.IsActive = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
materal.IsActive = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-18 19:58:14 +08:00
|
|
|
|
void OnCheckButtonClick()
|
|
|
|
|
|
{
|
2024-12-31 14:31:16 +08:00
|
|
|
|
//CloseWindow();
|
|
|
|
|
|
//UI_VehiclePartTreeController.Open(ID).Forget();
|
|
|
|
|
|
DebugUtil.Log("查看详细属性");
|
2024-12-18 19:58:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-25 12:40:51 +08:00
|
|
|
|
async void SetVehicleData(VehicleCultivateData data, DataVehicleComponent config = null)
|
2024-12-18 14:39:01 +08:00
|
|
|
|
{
|
2024-12-18 19:58:14 +08:00
|
|
|
|
#region 属性值
|
|
|
|
|
|
HideAllUpSign();
|
2024-12-18 14:39:01 +08:00
|
|
|
|
Color highLight = new Color(221 / 255.0f, 223 / 255.0f, 52 / 255.0f);
|
|
|
|
|
|
if (config == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Text_Value_Hp.text = data.Hp().ToString();
|
|
|
|
|
|
Text_Value_MemberCount.text = data.SeatCount().ToString();
|
|
|
|
|
|
Text_Value_Def.text = data.Defense().ToString();
|
|
|
|
|
|
Text_Value_Atk.text = data.Attack().ToString();
|
|
|
|
|
|
Text_Value_BulletCount.text = data.BulletCapacity().ToString();
|
|
|
|
|
|
Text_Value_Speed.text = data.MoveSpeed().ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Text_Value_Hp.text = (data.Hp() + config.HP).ToString();
|
|
|
|
|
|
if (config.HP > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
Image_UpBg_Hp.gameObject.SetActive(true);
|
|
|
|
|
|
Image_UpSign_Hp.gameObject.SetActive(true);
|
2024-12-18 19:58:14 +08:00
|
|
|
|
Text_UpTitle_Hp.color = highLight;
|
2024-12-18 14:39:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Text_Value_MemberCount.text = data.SeatCount().ToString();
|
|
|
|
|
|
|
|
|
|
|
|
Text_Value_Def.text = (data.Defense() + config.Defense).ToString();
|
|
|
|
|
|
if (config.Defense > 0)
|
2024-12-18 19:58:14 +08:00
|
|
|
|
{
|
|
|
|
|
|
Image_UpBg_Def.gameObject.SetActive(true);
|
|
|
|
|
|
Image_UpSign_Def.gameObject.SetActive(true);
|
|
|
|
|
|
Text_UpTitle_Def.color = highLight;
|
|
|
|
|
|
}
|
2024-12-18 14:39:01 +08:00
|
|
|
|
|
|
|
|
|
|
if (config.ComponentType != ComponentType.Component_2)
|
|
|
|
|
|
{
|
|
|
|
|
|
Text_Value_Atk.text = (data.Attack()).ToString();
|
2024-12-18 19:58:14 +08:00
|
|
|
|
Text_Value_BulletCount.text = (data.BulletCapacity()).ToString();
|
|
|
|
|
|
}
|
2024-12-18 14:39:01 +08:00
|
|
|
|
else
|
|
|
|
|
|
{
|
2025-03-17 18:46:12 +08:00
|
|
|
|
var batteryCfg = TableManager.Instance.Tables.BatteryConfig.Get(config.ComponentID);
|
2024-12-18 14:39:01 +08:00
|
|
|
|
var atk = batteryCfg.DamagePower;
|
|
|
|
|
|
var bulletCount = batteryCfg.MaxBulletCount;
|
|
|
|
|
|
Text_Value_Atk.text = atk.ToString();
|
|
|
|
|
|
Text_Value_BulletCount.text = bulletCount.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
bool isHighLight = atk > data.Attack();
|
|
|
|
|
|
Image_UpBg_Atk.gameObject.SetActive(isHighLight);
|
|
|
|
|
|
Image_UpSign_Atk.gameObject.SetActive(isHighLight);
|
|
|
|
|
|
Text_UpTitle_Atk.color = isHighLight ? highLight : Color.white;
|
|
|
|
|
|
|
|
|
|
|
|
isHighLight = bulletCount > data.BulletCapacity();
|
|
|
|
|
|
Image_UpBg_BulletCount.gameObject.SetActive(isHighLight);
|
|
|
|
|
|
Image_UpSign_BulletCount.gameObject.SetActive(isHighLight);
|
|
|
|
|
|
Text_UpTitle_BulletCount.color = isHighLight ? highLight : Color.white;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Text_Value_Speed.text = (data.MoveSpeed()).ToString();
|
|
|
|
|
|
}
|
2024-12-18 19:58:14 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 适应性
|
|
|
|
|
|
Text_Value_Ground.text = data.GetTerrainAdapt(BonusType.TerrainPlain).ToString();
|
|
|
|
|
|
Text_Value_Mountain.text = data.GetTerrainAdapt(BonusType.TerrainMountain).ToString();
|
|
|
|
|
|
Text_Value_Snow.text = data.GetTerrainAdapt(BonusType.TerrainSnow).ToString();
|
|
|
|
|
|
Text_Value_Wood.text = data.GetTerrainAdapt(BonusType.TerrainForest).ToString();
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 技能
|
|
|
|
|
|
DataSkill nowSkillCfg = TableManager.Instance.Tables.SkillConfig.Get(VehicleDataHelper.GetVehicleSkillId(data));
|
|
|
|
|
|
if (nowSkillCfg == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
nowSkillCfg = TableManager.Instance.Tables.SkillConfig.DataList[0];
|
|
|
|
|
|
DebugUtil.LogError("载具技能配置未能找到!载具ID为{0},技能ID为{1}\n>>请检查相关配置表:VehicleSkllUpgrade/SkillConfig_Vehicle", data.Cfg.ID, VehicleDataHelper.GetVehicleSkillId(data.Cfg.ID));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-30 12:23:00 +08:00
|
|
|
|
Text_SkillCoolingTimeValue.text = nowSkillCfg.ChargeParam.ToString() + "s";
|
2024-12-18 19:58:14 +08:00
|
|
|
|
Text_SkillName.text = CommonUtils.GetLocalizeText(E_LocalizePrefix.skill, nowSkillCfg.ID);
|
|
|
|
|
|
|
|
|
|
|
|
var skillIcon = await LoadAssetAsync<Sprite>(Framework.Constants.UI_Cultivata_skillIconFolder + nowSkillCfg.IconPath);
|
|
|
|
|
|
Image_SkillIcon.sprite = skillIcon;
|
|
|
|
|
|
|
|
|
|
|
|
Text_SkillInfo.text = CommonUtils.GetLocalizeText(E_LocalizePrefix.skill_desc, nowSkillCfg.ID);
|
|
|
|
|
|
#endregion
|
2024-12-18 14:39:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-18 19:58:14 +08:00
|
|
|
|
void HideAllUpSign()
|
2024-12-18 14:39:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
Image_UpBg_Atk.gameObject.SetActive(false);
|
|
|
|
|
|
Image_UpBg_Def.gameObject.SetActive(false);
|
|
|
|
|
|
Image_UpBg_Hp.gameObject.SetActive(false);
|
|
|
|
|
|
Image_UpBg_MemberCount.gameObject.SetActive(false);
|
|
|
|
|
|
Image_UpBg_BulletCount.gameObject.SetActive(false);
|
|
|
|
|
|
Image_UpBg_Speed.gameObject.SetActive(false);
|
|
|
|
|
|
Image_UpSign_Atk.gameObject.SetActive(false);
|
|
|
|
|
|
Image_UpSign_Def.gameObject.SetActive(false);
|
|
|
|
|
|
Image_UpSign_Hp.gameObject.SetActive(false);
|
|
|
|
|
|
Image_UpSign_MemberCount.gameObject.SetActive(false);
|
|
|
|
|
|
Image_UpSign_BulletCount.gameObject.SetActive(false);
|
|
|
|
|
|
Image_UpSign_Speed.gameObject.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
Text_UpTitle_Hp.color = Color.white;
|
|
|
|
|
|
Text_UpTitle_MemberCount.color = Color.white;
|
|
|
|
|
|
Text_UpTitle_Def.color = Color.white;
|
|
|
|
|
|
Text_UpTitle_Atk.color = Color.white;
|
|
|
|
|
|
Text_UpTitle_BulletCount.color = Color.white;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-16 14:07:41 +08:00
|
|
|
|
void OnSwitchAnim(bool isShow, Action callback = null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (isShow)
|
|
|
|
|
|
{
|
|
|
|
|
|
//play show anim
|
|
|
|
|
|
Image_Bg.GetComponent<RectTransform>().DOPivotX(1f, 0.5f).SetEase(Ease.OutBack).OnComplete(() => callback?.Invoke());
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Image_Bg.GetComponent<RectTransform>().DOPivotX(0f, 0.5f).OnComplete(() => callback?.Invoke());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//invoke when open window
|
|
|
|
|
|
protected override void OnShowWindow(object data = null)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//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()
|
|
|
|
|
|
{
|
2024-12-30 16:13:58 +08:00
|
|
|
|
m_ReleaseCallback?.Invoke();
|
2024-12-16 14:07:41 +08:00
|
|
|
|
base.OnRelease();
|
|
|
|
|
|
}
|
2024-12-17 15:00:40 +08:00
|
|
|
|
|
|
|
|
|
|
void OnUpgradeClick()
|
|
|
|
|
|
{
|
2024-12-19 16:09:04 +08:00
|
|
|
|
var node = VehicleCultivateManager.Instance.Get(ID);
|
|
|
|
|
|
if (node == null)
|
|
|
|
|
|
{
|
2024-12-30 12:41:33 +08:00
|
|
|
|
DebugUtil.Log("Vehicle Part Tree Detail ID: " + ID + " not found");
|
2024-12-19 16:09:04 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
2025-02-12 15:01:22 +08:00
|
|
|
|
if (node.ParentID.Count > 0)
|
2025-01-03 19:30:27 +08:00
|
|
|
|
{
|
2025-02-12 15:01:22 +08:00
|
|
|
|
foreach (var parent in node.ParentID)
|
2024-12-19 16:09:04 +08:00
|
|
|
|
{
|
2025-02-12 15:01:22 +08:00
|
|
|
|
TreeNodeBase parentNode = VehicleCultivateManager.Instance.Get(parent);
|
|
|
|
|
|
if (parentNode != null)
|
2025-01-03 19:30:27 +08:00
|
|
|
|
{
|
2025-02-12 15:01:22 +08:00
|
|
|
|
if (!parentNode.IsUpgraded())
|
|
|
|
|
|
{
|
|
|
|
|
|
CommonUtils.ShowMessageTips(CommonUtils.GetLocalizeText("vehicleCultivate_PreNodeLocked"));
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.Log("Vehicle Part Tree Detail ID: " + ID + " parent not found");
|
2025-01-03 19:30:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-02-12 15:01:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var parent = node.GetDirectVehicleParentNode();
|
|
|
|
|
|
if (parent != null && !parent.IsUpgraded())
|
2025-01-03 19:30:27 +08:00
|
|
|
|
{
|
2025-02-12 15:01:22 +08:00
|
|
|
|
CommonUtils.ShowMessageTips(CommonUtils.GetLocalizeText("vehicleCultivate_PreNodeLocked"));
|
|
|
|
|
|
return;
|
2024-12-19 16:09:04 +08:00
|
|
|
|
}
|
2024-12-30 12:41:33 +08:00
|
|
|
|
}
|
2024-12-19 16:09:04 +08:00
|
|
|
|
|
2024-12-17 15:00:40 +08:00
|
|
|
|
if (VehicleCultivateManager.Instance.Get(ID).Upgrade())
|
|
|
|
|
|
CloseWindow();
|
|
|
|
|
|
}
|
2025-02-12 17:25:08 +08:00
|
|
|
|
|
|
|
|
|
|
void OnEnterPartTreeClick()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (EnterPartTree != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
CloseWindow();
|
|
|
|
|
|
EnterPartTree?.Invoke();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-12-16 14:07:41 +08:00
|
|
|
|
}
|