update icon combo
This commit is contained in:
@@ -11,7 +11,7 @@ public class NPCVisual : MonoBehaviour
|
||||
protected CECNPC.INFO m_NPCInfo;
|
||||
[SerializeField] private Queue<string> _animationQueue = new Queue<string>();
|
||||
[SerializeField] private AnimancerState _currentState;
|
||||
private bool debugNamePlateBounds = true;
|
||||
private bool debugNamePlateBounds = false;
|
||||
private const float fadeTime = .2f;
|
||||
private const FadeMode FadeMode = Animancer.FadeMode.FixedDuration;
|
||||
|
||||
|
||||
@@ -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<AUIDialog>();
|
||||
// _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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user