更新
This commit is contained in:
@@ -26,6 +26,17 @@ namespace Continentis.MainGame.UI
|
||||
{
|
||||
foreach (var pointerArrow in pointerArrows) LeanPool.Despawn(pointerArrow.gameObject);
|
||||
pointerArrows.Clear();
|
||||
mainPointerArrow = null;
|
||||
}
|
||||
|
||||
/// <summary>移除并回收最后一支箭头(用于多目标选择的撤销操作)。</summary>
|
||||
public void RemoveLastPointerArrow()
|
||||
{
|
||||
if (pointerArrows.Count == 0) return;
|
||||
PointerArrow last = pointerArrows[^1];
|
||||
pointerArrows.RemoveAt(pointerArrows.Count - 1);
|
||||
if (last == mainPointerArrow) mainPointerArrow = null;
|
||||
LeanPool.Despawn(last.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,10 +22,29 @@ namespace Continentis.MainGame.UI
|
||||
public RoundHint roundHint;
|
||||
public Button endActionButton;
|
||||
|
||||
private Action currentButtonAction;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
endActionButton.onClick.AddListener(CombatMainManager.Instance.EndAction);
|
||||
endActionButton.onClick.AddListener(OnButtonClicked);
|
||||
// 默认绑定结束行动
|
||||
SetButtonAction(CombatMainManager.Instance.EndAction, "End Action", false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换按钮回调、文本和可交互状态,统一从此处管理。
|
||||
/// </summary>
|
||||
public void SetButtonAction(Action action, string label, bool interactable)
|
||||
{
|
||||
currentButtonAction = action;
|
||||
endActionButton.GetComponentInChildren<TMPro.TMP_Text>().text = label;
|
||||
endActionButton.interactable = interactable;
|
||||
}
|
||||
|
||||
private void OnButtonClicked()
|
||||
{
|
||||
currentButtonAction?.Invoke();
|
||||
}
|
||||
|
||||
public void ClearAllCardViews()
|
||||
|
||||
@@ -43,6 +43,13 @@ namespace Continentis.MainGame
|
||||
{
|
||||
combatMainPage.teamSwitchButton.UpdateTeamPileText(CombatMainManager.Instance.characterController.playerTeam);
|
||||
}
|
||||
|
||||
/// <summary>是否正处于多目标选择模式(左键/右键由 HandCardView 接管)。</summary>
|
||||
public bool IsInMultiTargetMode()
|
||||
{
|
||||
return selectingCardView is HandCardView handCard
|
||||
&& handCard.card.attributeSubmodule.targetCount > 1;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CombatUIManager
|
||||
@@ -53,6 +60,8 @@ namespace Continentis.MainGame
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool isMultiTargetMode = IsInMultiTargetMode();
|
||||
|
||||
Ray ray = combatCamera.ScreenPointToRay(Mouse.current.position.ReadValue());
|
||||
|
||||
@@ -63,7 +72,8 @@ namespace Continentis.MainGame
|
||||
hoveringCharacterView ??= hit.collider.GetComponent<CombatCharacterViewBase>();
|
||||
hoveringCharacterView.SetOutline(true);
|
||||
|
||||
if (Mouse.current.leftButton.wasPressedThisFrame)
|
||||
// 多目标模式下,左键由 HandCardView 处理,跳过默认的角色面板选中逻辑
|
||||
if (!isMultiTargetMode && Mouse.current.leftButton.wasPressedThisFrame)
|
||||
{
|
||||
if (hoveringCharacterView == selectingCharacterView)
|
||||
{
|
||||
@@ -80,7 +90,7 @@ namespace Continentis.MainGame
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Mouse.current.leftButton.wasPressedThisFrame)
|
||||
if (!isMultiTargetMode && Mouse.current.leftButton.wasPressedThisFrame)
|
||||
{
|
||||
selectingCharacterView?.hudContainer.DisableHUD("SelectingDot");
|
||||
selectingCharacterView = null;
|
||||
@@ -92,7 +102,7 @@ namespace Continentis.MainGame
|
||||
hoveringCharacterView?.SetOutline(false);
|
||||
hoveringCharacterView = null;
|
||||
|
||||
if (Mouse.current.leftButton.wasPressedThisFrame)
|
||||
if (!isMultiTargetMode && Mouse.current.leftButton.wasPressedThisFrame)
|
||||
{
|
||||
selectingCharacterView?.hudContainer.DisableHUD("SelectingDot");
|
||||
selectingCharacterView = null;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Continentis.MainGame.UI
|
||||
|
||||
public void Highlight(bool isHighlighted)
|
||||
{
|
||||
Debug.Log($"Highlighting {character.data.displayName}: {isHighlighted}");
|
||||
//Debug.Log($"Highlighting {character.data.displayName}: {isHighlighted}");
|
||||
|
||||
if (isHighlighted)
|
||||
{
|
||||
|
||||
@@ -27,10 +27,10 @@ namespace Continentis.MainGame.UI
|
||||
|
||||
int currentBlock = currentAttributes.GetRoundValue("Block");
|
||||
int currentDodge = currentAttributes.GetRoundValue("Dodge");
|
||||
int currentShield = currentAttributes.GetRoundValue("Shield");
|
||||
int currentTemporaryHealth = currentAttributes.GetRoundValue("TemporaryHealth");
|
||||
defenseModule.UpdateBlock(currentBlock);
|
||||
defenseModule.UpdateDodge(currentDodge);
|
||||
defenseModule.UpdateShield(currentShield);
|
||||
defenseModule.UpdateShield(currentTemporaryHealth);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user