From ef632e7f11fd980681c19b74b22f0af2d28ceba4 Mon Sep 17 00:00:00 2001 From: CuongNV <> Date: Mon, 20 Apr 2026 11:11:23 +0700 Subject: [PATCH] update icon combo --- Assets/PerfectWorld/Scripts/NPC/NPCVisual.cs | 2 +- .../Scripts/UI/GamePlay/AUIImagePicture.cs | 22 +------------------ .../UI/GamePlay/AUIToggleAssignSlot.cs | 20 ++++++++++++++++- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/Assets/PerfectWorld/Scripts/NPC/NPCVisual.cs b/Assets/PerfectWorld/Scripts/NPC/NPCVisual.cs index eca6c7a647..0ee2fb1358 100644 --- a/Assets/PerfectWorld/Scripts/NPC/NPCVisual.cs +++ b/Assets/PerfectWorld/Scripts/NPC/NPCVisual.cs @@ -11,7 +11,7 @@ public class NPCVisual : MonoBehaviour protected CECNPC.INFO m_NPCInfo; [SerializeField] private Queue _animationQueue = new Queue(); [SerializeField] private AnimancerState _currentState; - private bool debugNamePlateBounds = true; + private bool debugNamePlateBounds = false; private const float fadeTime = .2f; private const FadeMode FadeMode = Animancer.FadeMode.FixedDuration; diff --git a/Assets/PerfectWorld/Scripts/UI/GamePlay/AUIImagePicture.cs b/Assets/PerfectWorld/Scripts/UI/GamePlay/AUIImagePicture.cs index 6ffdda0042..8f9fc9a7d2 100644 --- a/Assets/PerfectWorld/Scripts/UI/GamePlay/AUIImagePicture.cs +++ b/Assets/PerfectWorld/Scripts/UI/GamePlay/AUIImagePicture.cs @@ -16,7 +16,6 @@ namespace BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay public class AUIImagePicture : AUIImagePictureBase { public const string DefaultComboIcon = "爱你"; - [SerializeField] Button skillbutton; [SerializeField] GameObject borderImage; [SerializeField] int cooldownTime; [SerializeField] AUIClockIcon m_ClockCounter; @@ -37,13 +36,6 @@ namespace BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay public override void Awake() { - if (skillbutton == null) - { - Debug.LogError("Skill Button is not assigned in AUIImagePicture"); - return; - } - skillbutton.onClick.RemoveAllListeners(); - skillbutton.onClick.AddListener(Execute); m_pParent = GetComponentInParent(); // _skillID = int.Parse(this.name.Split('_')[1]); } @@ -52,14 +44,11 @@ namespace BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay { if (isInteract) { - skillbutton.interactable = true; disPlayImage.color = Color.white; } else { disPlayImage.color = Color.gray; - - skillbutton.interactable = false; } } @@ -98,7 +87,6 @@ namespace BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay Debug.LogError("Skill Image is not assigned in AUIImagePicture"); return; } - skillbutton.interactable = true; disPlayImage.color = Color.white; disPlayImage.sprite = sprite; disPlayImage.gameObject.SetActive(true); @@ -107,11 +95,9 @@ namespace BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay } private IEnumerator CooldownRoutine() { - skillbutton.interactable = false; disPlayImage.color = Color.gray; yield return new WaitForSeconds(cooldownTime); disPlayImage.color = Color.white; - skillbutton.interactable = true; } public AUIClockIcon GetClockIcon() => m_ClockCounter; @@ -130,7 +116,6 @@ namespace BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay { // BMLogger.Log("Clear AUIImagePicture with name: " + name) ; base.Clear(); - skillbutton.interactable = true; if (disPlayImage != null) { disPlayImage.color = Color.white; @@ -222,17 +207,13 @@ namespace BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay continue; } - if (TrySetSkillGroupIconByNIcon(index, comboSkills[index].nIcon)) + if (TrySetDefaultSkillGroupIcon()) { return true; } } _skillGroupIndex = resolvedGroup; - if (TrySetDefaultSkillGroupIcon()) - { - return true; - } Clear(); return false; @@ -246,7 +227,6 @@ namespace BrewMonster.Assets.PerfectWorld.Scripts.UI.GamePlay return false; } - skillbutton.interactable = true; var uiMan = EC_Game.GetGameRun()?.GetUIManager()?.GetInGameUIMan(); if (uiMan == null) { diff --git a/Assets/PerfectWorld/Scripts/UI/GamePlay/AUIToggleAssignSlot.cs b/Assets/PerfectWorld/Scripts/UI/GamePlay/AUIToggleAssignSlot.cs index cb88015b6e..49965d096e 100644 --- a/Assets/PerfectWorld/Scripts/UI/GamePlay/AUIToggleAssignSlot.cs +++ b/Assets/PerfectWorld/Scripts/UI/GamePlay/AUIToggleAssignSlot.cs @@ -104,7 +104,7 @@ namespace BrewMonster continue; } - if (TrySetSkillGroupIconByNIcon(groupIndex, comboSkills[groupIndex].nIcon)) + if (TrySetDefaultSkillGroupIcon()) { return true; } @@ -114,6 +114,24 @@ namespace BrewMonster return false; } + private bool TrySetDefaultSkillGroupIcon() + { + var uiMan = EC_Game.GetGameRun()?.GetUIManager()?.GetInGameUIMan(); + if (uiMan == null) + { + return false; + } + + var icon = uiMan.GetIcon(DefaultComboIcon, EC_GAMEUI_ICONS.ICONS_SKILLGRP); + if (icon == null) + { + return false; + } + + SetImage(icon); + return true; + } + private bool TrySetSkillGroupIconByNIcon(int groupIndex, int nIcon) { _skillGroupIndex = groupIndex;