2024-12-30 16:13:58 +08:00
|
|
|
using Cysharp.Threading.Tasks;
|
|
|
|
|
using Framework;
|
|
|
|
|
using Gameplay;
|
|
|
|
|
using Gameplay.Common;
|
|
|
|
|
using Gameplay.Net;
|
|
|
|
|
using PhxhSDK;
|
2024-12-09 17:02:39 +08:00
|
|
|
using TMPro;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using Button = UnityEngine.UI.Button;
|
|
|
|
|
using Image = UnityEngine.UI.Image;
|
|
|
|
|
using Toggle = UnityEngine.UI.Toggle;
|
|
|
|
|
|
|
|
|
|
public class UI_VehiclePartTreeController : UIWindow
|
|
|
|
|
{
|
|
|
|
|
//UI GameObj
|
|
|
|
|
///Auto Gen Start///
|
|
|
|
|
public Image Image_Bg;
|
|
|
|
|
public Image Image_TreeBg1;
|
2024-12-12 19:11:59 +08:00
|
|
|
//public Button Button_Return;
|
2024-12-09 17:02:39 +08:00
|
|
|
public Button Button_back;
|
|
|
|
|
public TMP_Text Text_Back;
|
|
|
|
|
public Button Button_Home;
|
|
|
|
|
public Image Image_TreeBg0;
|
|
|
|
|
public Toggle Toggle_Dev;
|
|
|
|
|
public Toggle Toggle_Reinforce;
|
|
|
|
|
public Toggle Toggle_BlueMap;
|
|
|
|
|
public Toggle Toggle_Repair;
|
|
|
|
|
public PhxhScrollView ScrollView_PartsTree;
|
|
|
|
|
public Button Button_Back;
|
2024-12-12 19:11:59 +08:00
|
|
|
|
2024-12-09 17:02:39 +08:00
|
|
|
///Auto Gen End///
|
2024-12-12 19:11:59 +08:00
|
|
|
|
|
|
|
|
private long curVehicleID = -1;
|
|
|
|
|
|
|
|
|
|
private GameObject uiPrefab;
|
|
|
|
|
|
2024-12-30 16:13:58 +08:00
|
|
|
private GameObject highLightNode;
|
|
|
|
|
|
2024-12-12 19:11:59 +08:00
|
|
|
public async static UniTask<UIWindow> Open(object data = null)
|
|
|
|
|
{
|
|
|
|
|
return await UIManager.Instance.CreateAndOpenWindow(UINameConst.UI_VehiclePartTree, data);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-09 17:02:39 +08:00
|
|
|
// deal with input data
|
|
|
|
|
public override void PreLoad(object data = null)
|
2024-12-12 19:11:59 +08:00
|
|
|
{
|
|
|
|
|
curVehicleID = (long)data;
|
|
|
|
|
|
|
|
|
|
var path = string.Format(UIManager.UI_PREFAB_PATH, "Interface_Vehicle/TechTree/TechTree_" + curVehicleID);
|
|
|
|
|
PostPreload<GameObject>(path).Forget();
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-30 16:13:58 +08:00
|
|
|
// Use this for initialization
|
|
|
|
|
public override void OnInit()
|
2024-12-09 17:02:39 +08:00
|
|
|
{
|
|
|
|
|
//bind UI GameObj
|
|
|
|
|
UI_VehiclePartTreeBinder.GetComponents(this);
|
2024-12-30 16:13:58 +08:00
|
|
|
var currencyList = GetComponent<UI_CurrencyList>("UI_CurrencyList");
|
2025-04-25 14:57:32 +08:00
|
|
|
currencyList.SetData(GLConfig.Inst.data.DiamondItemId, 12);//GLConfig.Inst.data.GoldItemId
|
2024-12-12 19:11:59 +08:00
|
|
|
|
2025-02-12 17:25:08 +08:00
|
|
|
//Button_Back.gameObject.AddComponent<WarningCode>();
|
|
|
|
|
|
2024-12-30 16:13:58 +08:00
|
|
|
BindButton(Button_back, OnClickBack);
|
2025-01-15 17:25:50 +08:00
|
|
|
BindButton(Button_Home, OnClickHome);
|
2024-12-30 16:13:58 +08:00
|
|
|
BindButton(Button_Back, () =>
|
|
|
|
|
{
|
|
|
|
|
var parentID = VehicleCultivateManager.Instance.GetVehicleParent(curVehicleID).ID;
|
2025-04-25 16:09:50 +08:00
|
|
|
var cfg = TableManager.Instance.Tables.VehicleConfig.DataMap[(int)parentID];
|
|
|
|
|
if (cfg == null)
|
|
|
|
|
return;
|
|
|
|
|
if (cfg.HideInTree)
|
|
|
|
|
{
|
|
|
|
|
CommonUtils.HideVehicleTip();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-12-30 16:13:58 +08:00
|
|
|
curVehicleID = parentID;
|
|
|
|
|
UpdateTreePrefab();
|
|
|
|
|
});
|
2024-12-12 19:11:59 +08:00
|
|
|
|
2024-12-30 16:13:58 +08:00
|
|
|
var path = string.Format(UIManager.UI_PREFAB_PATH, "Interface_Vehicle/TechTree/TechTree_" + curVehicleID);
|
2025-01-15 15:25:23 +08:00
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
uiPrefab = GameObject.Instantiate(GetPreLoadResult<GameObject>(path), ScrollView_PartsTree.content, false);
|
2025-04-15 16:23:10 +08:00
|
|
|
var uiPrefabSize = uiPrefab.GetComponent<RectTransform>().sizeDelta;
|
2025-04-28 14:45:00 +08:00
|
|
|
|
|
|
|
|
ScrollView_PartsTree.content.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, uiPrefabSize.y);
|
|
|
|
|
ScrollView_PartsTree.content.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, uiPrefabSize.x);
|
2025-04-15 16:23:10 +08:00
|
|
|
}
|
2025-04-28 14:45:00 +08:00
|
|
|
catch
|
2025-01-15 15:25:23 +08:00
|
|
|
{
|
|
|
|
|
DebugUtil.LogError("科技树预制体加载失败:" + curVehicleID + ",请检查是否已生成");
|
|
|
|
|
}
|
2024-12-16 12:04:37 +08:00
|
|
|
|
2024-12-30 16:13:58 +08:00
|
|
|
EventManager.Instance.Register(EventManager.EventName.VehecleUpgrade, UpdateTreeNode);
|
2024-12-31 12:55:44 +08:00
|
|
|
|
2025-02-06 11:51:36 +08:00
|
|
|
highLightNode = CommonUtils.GetGameObject(uiPrefab, "v_" + curVehicleID);
|
|
|
|
|
if (highLightNode != null)
|
|
|
|
|
{
|
|
|
|
|
var img = CommonUtils.GetComponent<Image>(highLightNode, "Image_CurrentVehicle/Image_SelectBorder");
|
|
|
|
|
if (img != null)
|
|
|
|
|
{
|
|
|
|
|
highLightNode = img.gameObject;
|
|
|
|
|
img.enabled = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UI_VehiclePartTreeDetailController.Open(curVehicleID, OnReleaseCallback: HideHighlight).Forget();
|
2024-12-31 12:55:44 +08:00
|
|
|
}
|
2024-12-09 17:02:39 +08:00
|
|
|
|
2024-12-30 16:13:58 +08:00
|
|
|
//invoke when open window
|
|
|
|
|
protected override void OnShowWindow(object data = null)
|
2024-12-09 17:02:39 +08:00
|
|
|
{
|
2024-12-12 19:11:59 +08:00
|
|
|
UpdateTreeNode();
|
2024-12-30 16:13:58 +08:00
|
|
|
var currencyList = GetComponent<UI_CurrencyList>("UI_CurrencyList");
|
|
|
|
|
currencyList.Refresh();
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-09 17:02:39 +08:00
|
|
|
//invoke when reload window
|
|
|
|
|
protected override void OnReloadWindow(object data = null)
|
|
|
|
|
{
|
2024-12-30 16:13:58 +08:00
|
|
|
|
2024-12-09 17:02:39 +08:00
|
|
|
}
|
2024-12-30 16:13:58 +08:00
|
|
|
|
2024-12-09 17:02:39 +08:00
|
|
|
//invoke when close window
|
|
|
|
|
protected override void OnHideWindow()
|
|
|
|
|
{
|
2024-12-30 16:13:58 +08:00
|
|
|
|
2024-12-09 17:02:39 +08:00
|
|
|
}
|
2024-12-30 16:13:58 +08:00
|
|
|
|
2024-12-09 17:02:39 +08:00
|
|
|
//invoke when destroy
|
|
|
|
|
public override void OnRelease()
|
|
|
|
|
{
|
2024-12-30 16:13:58 +08:00
|
|
|
base.OnRelease();
|
|
|
|
|
CommonUtils.ScreenshotReset();
|
2024-12-16 12:04:37 +08:00
|
|
|
|
2024-12-30 16:13:58 +08:00
|
|
|
EventManager.Instance.Unregister(EventManager.EventName.VehecleUpgrade, UpdateTreeNode);
|
|
|
|
|
}
|
2024-12-12 19:11:59 +08:00
|
|
|
|
2024-12-16 13:20:15 +08:00
|
|
|
/// <summary>
|
2024-12-19 13:09:17 +08:00
|
|
|
/// 加载树形结构预制体
|
2024-12-16 13:20:15 +08:00
|
|
|
/// </summary>
|
2024-12-30 16:13:58 +08:00
|
|
|
async void UpdateTreePrefab()
|
2024-12-12 19:11:59 +08:00
|
|
|
{
|
|
|
|
|
var path = string.Format(UIManager.UI_PREFAB_PATH, "Interface_Vehicle/TechTree/TechTree_" + curVehicleID);
|
|
|
|
|
var go = await AssetManager.Instance.LoadAssetAsync<GameObject>(path);
|
|
|
|
|
if (go == null)
|
|
|
|
|
{
|
|
|
|
|
DebugUtil.LogError("go is null");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (uiPrefab != null)
|
|
|
|
|
{
|
|
|
|
|
Destroy(uiPrefab);
|
|
|
|
|
}
|
|
|
|
|
uiPrefab = GameObject.Instantiate(go, ScrollView_PartsTree.content, false);
|
2025-04-15 16:23:10 +08:00
|
|
|
var uiPrefabSize = uiPrefab.GetComponent<RectTransform>().sizeDelta;
|
2025-04-28 14:45:00 +08:00
|
|
|
|
|
|
|
|
ScrollView_PartsTree.content.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, uiPrefabSize.y);
|
|
|
|
|
ScrollView_PartsTree.content.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, uiPrefabSize.x);
|
|
|
|
|
UpdateTreeNode();
|
2024-12-12 19:11:59 +08:00
|
|
|
|
2025-02-06 18:29:33 +08:00
|
|
|
highLightNode = CommonUtils.GetGameObject(uiPrefab, "v_" + curVehicleID);
|
|
|
|
|
if (highLightNode != null)
|
|
|
|
|
{
|
|
|
|
|
var img = CommonUtils.GetComponent<Image>(highLightNode, "Image_CurrentVehicle/Image_SelectBorder");
|
|
|
|
|
if (img != null)
|
|
|
|
|
{
|
|
|
|
|
highLightNode = img.gameObject;
|
|
|
|
|
img.enabled = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UI_VehiclePartTreeDetailController.Open(curVehicleID, OnReleaseCallback: HideHighlight).Forget();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 更新树形结构节点显示内容
|
|
|
|
|
/// </summary>
|
|
|
|
|
void UpdateTreeNode()
|
2024-12-12 19:11:59 +08:00
|
|
|
{
|
|
|
|
|
var partTree = VehicleCultivateManager.Instance.GetPartialTree(curVehicleID);
|
|
|
|
|
|
|
|
|
|
if (VehicleCultivateManager.Instance.GetVehicleParent(curVehicleID) == null)
|
|
|
|
|
{
|
|
|
|
|
Button_Back.gameObject.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Button_Back.gameObject.SetActive(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (partTree == null)
|
|
|
|
|
{
|
|
|
|
|
DebugUtil.LogError("partTree is null");
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-12-16 12:04:37 +08:00
|
|
|
GameObject rootVehicleNode = CommonUtils.GetGameObject(uiPrefab, "v_" + curVehicleID);
|
|
|
|
|
CommonUtils.GetComponent<TMP_Text>(rootVehicleNode, "Image_CurrentVehicle/Text_PartName").text
|
|
|
|
|
= VehicleDataHelper.GetVehicleLocalizeName((int)curVehicleID);
|
|
|
|
|
|
2025-01-08 16:01:19 +08:00
|
|
|
CommonUtils.GetComponent<TMP_Text>(rootVehicleNode, "Image_CurrentVehicle/Text_VehicleTypeName").text
|
|
|
|
|
= VehicleDataHelper.GetVehicleCategory((int)curVehicleID);
|
|
|
|
|
|
2024-12-30 16:13:58 +08:00
|
|
|
VehicleInfo data = Actor.Instance.Character.GetVehicleDevelopment(curVehicleID);
|
|
|
|
|
foreach (var node in partTree)
|
2024-12-12 19:11:59 +08:00
|
|
|
{
|
|
|
|
|
var id = node.ID;
|
2024-12-16 12:04:37 +08:00
|
|
|
var treeNode = CommonUtils.GetGameObject(uiPrefab, "v_" + id);
|
2025-02-24 14:07:33 +08:00
|
|
|
DebugUtil.Log("find node: " + id);
|
2024-12-12 19:11:59 +08:00
|
|
|
if (treeNode == null)
|
|
|
|
|
{
|
|
|
|
|
DebugUtil.LogError("treeNode is null");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
var button = treeNode.GetComponent<Button>();
|
|
|
|
|
if (button == null)
|
|
|
|
|
{
|
|
|
|
|
DebugUtil.LogError("button is null");
|
|
|
|
|
}
|
2024-12-16 14:07:41 +08:00
|
|
|
BindButton(button, () => OnNodeClick(node));
|
2024-12-12 19:11:59 +08:00
|
|
|
|
2024-12-16 12:04:37 +08:00
|
|
|
bool unlock = false;
|
|
|
|
|
if (node is VehicleTreeNode vehicleNode)
|
|
|
|
|
{
|
2024-12-30 16:13:58 +08:00
|
|
|
unlock = Actor.Instance.Character.GetVehicleDevelopment(vehicleNode.ID) != null;
|
2024-12-16 12:04:37 +08:00
|
|
|
|
2025-02-24 14:07:33 +08:00
|
|
|
#region name
|
|
|
|
|
var Text_name = CommonUtils.GetGameObject(treeNode.transform.GetChild(0).gameObject, "Text_Name");//GetComponent<TMP_Text>(treeNode.transform.GetChild(0).gameObject, "Text_Name");
|
|
|
|
|
if (Text_name != null)
|
|
|
|
|
{
|
|
|
|
|
Text_name.GetComponent<TMP_Text>().text = VehicleDataHelper.GetVehicleLocalizeName((int)vehicleNode.ID);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region vehicle_level
|
|
|
|
|
var Text_level = CommonUtils.GetComponent<TMP_Text>(treeNode.transform.GetChild(0).gameObject, "Text_Level");
|
2024-12-16 12:04:37 +08:00
|
|
|
if (Text_level != null)
|
2024-12-30 16:13:58 +08:00
|
|
|
{
|
|
|
|
|
var vehicleLevel = 1;
|
|
|
|
|
if (TableManager.Instance.Tables.VehicleConfig.DataMap.ContainsKey((int)vehicleNode.ID))
|
|
|
|
|
vehicleLevel = TableManager.Instance.Tables.VehicleConfig.DataMap[(int)vehicleNode.ID].VehicleLevel;
|
|
|
|
|
Text_level.text = CommonUtils.GetRomanCode(vehicleLevel);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
else if (node is VehicleComponentTreeNode componentNode)
|
2024-12-16 12:04:37 +08:00
|
|
|
{
|
|
|
|
|
if (data != null)
|
|
|
|
|
unlock = data.UpgradedComponents.Contains((uint)componentNode.ID);
|
|
|
|
|
|
2024-12-30 16:13:58 +08:00
|
|
|
#region component_level
|
2024-12-16 12:04:37 +08:00
|
|
|
var Text_level = CommonUtils.GetComponent<TMP_Text>(treeNode.transform.GetChild(0).gameObject, "Text_Level");
|
|
|
|
|
if (Text_level != null)
|
|
|
|
|
{
|
|
|
|
|
int compLevel = (int)(componentNode.ID % 100);
|
|
|
|
|
Text_level.text = CommonUtils.GetRomanCode(compLevel);
|
|
|
|
|
}
|
2024-12-30 16:13:58 +08:00
|
|
|
#endregion
|
|
|
|
|
}
|
2024-12-16 12:04:37 +08:00
|
|
|
|
2024-12-12 19:11:59 +08:00
|
|
|
|
2024-12-30 16:13:58 +08:00
|
|
|
var tag = treeNode.transform.GetChild(0).Find("Image_Unlock");
|
2024-12-18 19:58:14 +08:00
|
|
|
var cost = treeNode.transform.GetChild(0).Find("Text_Cost");
|
2024-12-30 16:13:58 +08:00
|
|
|
var vehicleCostText = treeNode.transform.GetChild(0).Find("Text_CostValue");
|
2025-02-24 14:07:33 +08:00
|
|
|
var vehicleCostBG = treeNode.transform.GetChild(0).Find("Image_Bar");
|
2024-12-18 19:58:14 +08:00
|
|
|
|
2024-12-30 16:13:58 +08:00
|
|
|
if (tag == null)
|
2024-12-12 19:11:59 +08:00
|
|
|
{
|
|
|
|
|
DebugUtil.LogWarning("tag is null");
|
|
|
|
|
}
|
2024-12-16 12:04:37 +08:00
|
|
|
if (!unlock)
|
2024-12-12 19:11:59 +08:00
|
|
|
{
|
|
|
|
|
if (tag != null)
|
|
|
|
|
tag.gameObject.SetActive(false);
|
2024-12-17 13:26:31 +08:00
|
|
|
if (cost != null)
|
|
|
|
|
{
|
|
|
|
|
cost.gameObject.SetActive(true);
|
|
|
|
|
var itemCost = node.GetUpgradeCost();
|
|
|
|
|
cost.GetComponent<TMP_Text>().text = itemCost.Counts[0].ToString();
|
|
|
|
|
}
|
2024-12-18 19:58:14 +08:00
|
|
|
if (vehicleCostText != null)
|
2024-12-30 16:13:58 +08:00
|
|
|
{
|
|
|
|
|
vehicleCostText.gameObject.SetActive(true);
|
|
|
|
|
var itemCost = node.GetUpgradeCost();
|
|
|
|
|
vehicleCostText.GetComponent<TMP_Text>().text = itemCost.Counts[0].ToString();
|
|
|
|
|
}
|
2025-02-24 14:07:33 +08:00
|
|
|
if (vehicleCostBG != null)
|
|
|
|
|
{
|
|
|
|
|
vehicleCostBG.gameObject.SetActive(true);
|
|
|
|
|
}
|
2024-12-12 19:11:59 +08:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (tag != null)
|
|
|
|
|
tag.gameObject.SetActive(true);
|
2024-12-17 13:26:31 +08:00
|
|
|
if (cost != null)
|
|
|
|
|
cost.gameObject.SetActive(false);
|
2024-12-18 19:58:14 +08:00
|
|
|
if (vehicleCostText != null)
|
2024-12-30 16:13:58 +08:00
|
|
|
vehicleCostText.gameObject.SetActive(false);
|
2025-02-24 14:07:33 +08:00
|
|
|
if (vehicleCostBG != null)
|
|
|
|
|
vehicleCostBG.gameObject.SetActive(false);
|
2024-12-12 19:11:59 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-16 14:07:41 +08:00
|
|
|
/// <summary>
|
2024-12-19 13:09:17 +08:00
|
|
|
/// 树节点点击事件
|
2024-12-16 14:07:41 +08:00
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="node"></param>
|
|
|
|
|
void OnNodeClick(TreeNodeBase node)
|
|
|
|
|
{
|
|
|
|
|
var id = node.ID;
|
2024-12-30 16:13:58 +08:00
|
|
|
DebugUtil.Log("click node: " + id);
|
2025-02-06 11:51:36 +08:00
|
|
|
HideHighlight();
|
|
|
|
|
|
2024-12-17 13:26:31 +08:00
|
|
|
if (node is VehicleTreeNode Vehicle)
|
|
|
|
|
{
|
2025-04-25 16:09:50 +08:00
|
|
|
var cfg = TableManager.Instance.Tables.VehicleConfig.GetOrDefault((int)Vehicle.ID);
|
|
|
|
|
if (cfg == null)
|
|
|
|
|
return;
|
|
|
|
|
if (cfg.HideInTree)
|
|
|
|
|
{
|
|
|
|
|
CommonUtils.HideVehicleTip();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-12-17 13:26:31 +08:00
|
|
|
if (curVehicleID != Vehicle.ID)
|
|
|
|
|
{
|
2025-02-12 17:25:08 +08:00
|
|
|
//curVehicleID = Vehicle.ID;
|
|
|
|
|
//UpdateTreePrefab();
|
|
|
|
|
var vehicle = Vehicle.ID;
|
|
|
|
|
highLightNode = CommonUtils.GetGameObject(uiPrefab, "v_" + id);
|
|
|
|
|
if (highLightNode != null)
|
|
|
|
|
{
|
|
|
|
|
var img = CommonUtils.GetComponent<Image>(highLightNode, "Image_PartTreeVehicle/Image_SelectBorder");
|
|
|
|
|
if (img != null)
|
|
|
|
|
{
|
|
|
|
|
highLightNode = img.gameObject;
|
|
|
|
|
img.enabled = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UI_VehiclePartTreeDetailController.Open(id, EnterPartTree: () =>
|
|
|
|
|
{
|
|
|
|
|
curVehicleID = vehicle;
|
|
|
|
|
UpdateTreePrefab();
|
|
|
|
|
}, OnReleaseCallback: HideHighlight).Forget();
|
|
|
|
|
}
|
|
|
|
|
else
|
2025-02-06 11:51:36 +08:00
|
|
|
{
|
|
|
|
|
highLightNode = CommonUtils.GetGameObject(uiPrefab, "v_" + id);
|
|
|
|
|
if (highLightNode != null)
|
|
|
|
|
{
|
|
|
|
|
var img = CommonUtils.GetComponent<Image>(highLightNode, "Image_CurrentVehicle/Image_SelectBorder");
|
|
|
|
|
if (img != null)
|
|
|
|
|
{
|
|
|
|
|
highLightNode = img.gameObject;
|
|
|
|
|
img.enabled = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UI_VehiclePartTreeDetailController.Open(id, OnReleaseCallback: HideHighlight).Forget();
|
|
|
|
|
}
|
2024-12-17 13:26:31 +08:00
|
|
|
}
|
2024-12-16 14:07:41 +08:00
|
|
|
else
|
2024-12-30 16:20:18 +08:00
|
|
|
{
|
|
|
|
|
highLightNode = CommonUtils.GetGameObject(uiPrefab, "v_" + id);
|
2024-12-30 16:13:58 +08:00
|
|
|
if (highLightNode != null)
|
|
|
|
|
{
|
2025-02-06 11:51:36 +08:00
|
|
|
var img = CommonUtils.GetComponent<Image>(highLightNode, "Image_Part/Image_SelectBorder");
|
|
|
|
|
if(img != null)
|
|
|
|
|
{
|
|
|
|
|
highLightNode = img.gameObject;
|
|
|
|
|
img.enabled = true;
|
|
|
|
|
}
|
2024-12-30 16:13:58 +08:00
|
|
|
}
|
|
|
|
|
UI_VehiclePartTreeDetailController.Open(id, OnReleaseCallback: HideHighlight).Forget();
|
2024-12-16 14:07:41 +08:00
|
|
|
}
|
2024-12-30 16:13:58 +08:00
|
|
|
}
|
2024-12-12 19:11:59 +08:00
|
|
|
|
|
|
|
|
void OnClickBack()
|
2024-12-30 16:13:58 +08:00
|
|
|
{
|
2024-12-12 19:11:59 +08:00
|
|
|
CloseWindow();
|
2024-12-30 16:13:58 +08:00
|
|
|
}
|
2025-03-25 19:29:50 +08:00
|
|
|
void OnClickHome()
|
2025-01-15 17:25:50 +08:00
|
|
|
{
|
2025-04-10 17:37:01 +08:00
|
|
|
CommonUtils.HomeToMain();
|
2025-01-15 17:25:50 +08:00
|
|
|
}
|
2024-12-30 16:13:58 +08:00
|
|
|
void HideHighlight()
|
|
|
|
|
{
|
|
|
|
|
if (highLightNode != null)
|
2025-02-06 11:51:36 +08:00
|
|
|
CommonUtils.GetComponent<Image>(highLightNode).enabled = false;
|
2024-12-30 16:13:58 +08:00
|
|
|
}
|
2024-12-12 19:11:59 +08:00
|
|
|
|
|
|
|
|
}
|