彻底修好了
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using Continentis.MainGame.UI;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
@@ -75,6 +76,12 @@ namespace Continentis.MainGame.Card
|
||||
{
|
||||
CardInstance cardInstance = new CardInstance(CardLogicBase.GenerateCardLogic(data), owner, pileName, index);
|
||||
cardInstance.cardLogic.Initialize();
|
||||
|
||||
if (owner == CombatMainManager.Instance.characterController.playerTeam)
|
||||
{
|
||||
CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(CombatMainManager.Instance.characterController.playerTeam);
|
||||
}
|
||||
|
||||
return cardInstance;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using Continentis.MainGame.UI;
|
||||
@@ -246,23 +247,22 @@ namespace Continentis.MainGame.Card
|
||||
return;
|
||||
}
|
||||
|
||||
if (!validTargets.Contains(hoveringCharacter))
|
||||
{
|
||||
// 当前鼠标悬停的目标不在有效目标列表中
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cardLogic.HasKeyword("TargetSelf"))
|
||||
{
|
||||
|
||||
if (!validTargets.Contains(hoveringCharacter))
|
||||
{
|
||||
// 当前鼠标悬停的目标不在有效目标列表中
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 根据目标类型,打出卡牌
|
||||
if (cardLogic.attributeSubmodule.targetCount == 1)
|
||||
{
|
||||
if (hoveringCharacter != null)
|
||||
if (hoveringCharacter != null && validTargets.Contains(hoveringCharacter))
|
||||
{
|
||||
if (!cardLogic.Play(new List<CharacterBase>() { CombatUIManager.Instance.hoveringCharacterView.character }))
|
||||
if (!cardLogic.Play(new List<CharacterBase>() { hoveringCharacter }))
|
||||
{
|
||||
cardLogic.eventSubmodule.onUntargeting();
|
||||
cardLogic.contentSubmodule.dirtyMark = true;
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace Continentis.MainGame.Combat
|
||||
{
|
||||
characterController.Initialize(MainGameManager.Instance.playerHeroDataList, MainGameManager.Instance.enemyDataList);
|
||||
StartCombat();
|
||||
CombatUIManager.Instance.UpdateAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ namespace Continentis.MainGame.UI
|
||||
|
||||
public bool isUpdatingLayout = true; // 是否启用自动布局更新
|
||||
public float arcAngle = 15; // 手牌的总弧度
|
||||
//public float cardSpacing = 150f; // 手牌间距
|
||||
public float cardSpacingBase = 100f; // 手牌间距
|
||||
public float cardSpacingFactor = 500f; // 手牌间距调整因子
|
||||
public float maxVerticalOffset = 50f; // 控制最外侧卡牌的垂直偏移
|
||||
|
||||
private void Update()
|
||||
@@ -25,7 +26,7 @@ namespace Continentis.MainGame.UI
|
||||
if (count == 0 || index < 0)
|
||||
return Vector2.zero;
|
||||
|
||||
float cardSpacing = 100f + 500f / count;
|
||||
float cardSpacing = cardSpacingBase + cardSpacingFactor / count;
|
||||
|
||||
// 计算中间索引,保证手牌居中排列
|
||||
float midIndex = (count - 1) / 2f;
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Continentis.MainGame.UI
|
||||
public bool isTeam;
|
||||
public Button button;
|
||||
public TMP_Text buttonText;
|
||||
public TMP_Text teamPileText;
|
||||
private void Awake()
|
||||
{
|
||||
isTeam = false;
|
||||
@@ -25,11 +26,13 @@ namespace Continentis.MainGame.UI
|
||||
{
|
||||
SwitchToTeam();
|
||||
buttonText.text = "Team";
|
||||
teamPileText.gameObject.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SwitchToCurrentCharacter();
|
||||
buttonText.text = "Hero";
|
||||
teamPileText.gameObject.SetActive(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -74,5 +77,12 @@ namespace Continentis.MainGame.UI
|
||||
throw new Exception("当前角色不是玩家角色,无法显示卡牌。");
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateTeamPileText(CombatTeam team)
|
||||
{
|
||||
int currentCardCount = team.deckSubmodule.HandPile.Count;
|
||||
teamPileText.text = $"{currentCardCount}/10";
|
||||
Debug.Log($"Updated team pile text: {teamPileText.text}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using Continentis.MainGame.UI;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
@@ -37,6 +38,11 @@ namespace Continentis.MainGame
|
||||
{
|
||||
return uiPageList.Count == 1 && uiPageList.Contains(combatMainPage);
|
||||
}
|
||||
|
||||
public void UpdateAll()
|
||||
{
|
||||
combatMainPage.teamSwitchButton.UpdateTeamPileText(CombatMainManager.Instance.characterController.playerTeam);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CombatUIManager
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Continentis.MainGame.UI
|
||||
{
|
||||
string paramKey = synchronizedParameters[index];
|
||||
Func<string> func = buff.contentSubmodule.parameterGetters[paramKey];
|
||||
Debug.Log($"Updating buff icon text for parameter {paramKey} with func is {func != null}");
|
||||
//Debug.Log($"Updating buff icon text for parameter {paramKey} with func is {func != null}");
|
||||
SetText(index, func);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace SLSFramework.General
|
||||
isBusy = true;
|
||||
Tuple<CommandBase, CommandContext> nextEntry = commandQueue.First.Value;
|
||||
commandQueue.RemoveFirst();
|
||||
Debug.Log($"[Queue] 开始执行指令: {nextEntry.Item1.GetType()},队列剩余长度: {commandQueue.Count}");
|
||||
//Debug.Log($"[Queue] 开始执行指令: {nextEntry.Item1.GetType()},队列剩余长度: {commandQueue.Count}");
|
||||
var commandToExecute = nextEntry.Item1;
|
||||
var context = nextEntry.Item2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user