尝试修改丢text的情况

This commit is contained in:
SoulliesOfficial
2025-12-14 00:51:34 -05:00
parent c260d0740c
commit e60ef64d01
12 changed files with 151 additions and 19 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e164e1d4c54c82642aff8894a1571338
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,92 @@
<linker>
<assembly fullname="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="Assets.PixelFantasy.Common.Scripts.CollectionScripts.SpriteCollection" preserve="all" />
<type fullname="Assets.PixelFantasy.Common.Scripts.SoloState" preserve="all" />
<type fullname="Assets.PixelFantasy.PixelHeroes.Common.Scripts.CharacterScripts.Character" preserve="all" />
<type fullname="Assets.PixelFantasy.PixelHeroes.Common.Scripts.CharacterScripts.CharacterBuilder" preserve="all" />
<type fullname="Continentis.MainGame.Card.CardData" preserve="all" />
<type fullname="Continentis.MainGame.Character.CharacterData" preserve="all" />
<type fullname="Continentis.MainGame.Character.CombatCharacterViewBase" preserve="all" />
<type fullname="Continentis.MainGame.UI.HUD_BaseIcon" preserve="all" />
<type fullname="Continentis.MainGame.UI.HUD_CharacterBuffCollection" preserve="all" />
<type fullname="Continentis.MainGame.UI.HUD_CharacterBuffIcon" preserve="all" />
<type fullname="Continentis.MainGame.UI.HUD_Intention" preserve="all" />
<type fullname="Continentis.MainGame.UI.HUD_MainAttributesBar" preserve="all" />
<type fullname="Continentis.MainGame.UI.HUD_SelectingDot" preserve="all" />
<type fullname="Continentis.MainGame.UI.HUDData" preserve="all" />
<type fullname="Assets.PixelFantasy.Common.Scripts.CollectionScripts.Layer" preserve="nothing" serialized="true" />
<type fullname="Assets.PixelFantasy.PixelHeroes.Common.Scripts.CharacterScripts.Firearm" preserve="nothing" serialized="true" />
<type fullname="Continentis.MainGame.UI.HUD_MainAttributesBar/DefenseModule" preserve="nothing" serialized="true" />
<type fullname="Continentis.MainGame.UI.HUD_MainAttributesBar/HealthBar" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="Unity.2D.Animation.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.U2D.Animation.SpriteLibrary" preserve="all" />
<type fullname="UnityEngine.U2D.Animation.SpriteResolver" preserve="all" />
</assembly>
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
</assembly>
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
</assembly>
<assembly fullname="Unity.TextMeshPro, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="TMPro.TextMeshProUGUI" preserve="all" />
<type fullname="TMPro.TMP_FontAsset" preserve="all" />
<type fullname="TMPro.FaceInfo_Legacy" preserve="nothing" serialized="true" />
<type fullname="TMPro.FontAssetCreationSettings" preserve="nothing" serialized="true" />
<type fullname="TMPro.KerningTable" preserve="nothing" serialized="true" />
<type fullname="TMPro.TMP_Character" preserve="nothing" serialized="true" />
<type fullname="TMPro.TMP_FontFeatureTable" preserve="nothing" serialized="true" />
<type fullname="TMPro.TMP_FontWeightPair" preserve="nothing" serialized="true" />
<type fullname="TMPro.VertexGradient" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.AnimationClip" preserve="all" />
<type fullname="UnityEngine.Animator" preserve="all" />
<type fullname="UnityEngine.RuntimeAnimatorController" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.AudioModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.AudioClip" preserve="all" />
<type fullname="UnityEngine.AudioSource" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.GameObject" preserve="all" />
<type fullname="UnityEngine.Material" preserve="all" />
<type fullname="UnityEngine.Object" preserve="all" />
<type fullname="UnityEngine.RectTransform" preserve="all" />
<type fullname="UnityEngine.Shader" preserve="all" />
<type fullname="UnityEngine.Sprite" preserve="all" />
<type fullname="UnityEngine.SpriteRenderer" preserve="all" />
<type fullname="UnityEngine.Texture2D" preserve="all" />
<type fullname="UnityEngine.Transform" preserve="all" />
<type fullname="UnityEngine.Events.PersistentCallGroup" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.RectOffset" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.BoxCollider" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.UI.ContentSizeFitter" preserve="all" />
<type fullname="UnityEngine.UI.GridLayoutGroup" preserve="all" />
<type fullname="UnityEngine.UI.HorizontalLayoutGroup" preserve="all" />
<type fullname="UnityEngine.UI.Image" preserve="all" />
<type fullname="UnityEngine.UI.Mask" preserve="all" />
<type fullname="UnityEngine.UI.MaskableGraphic/CullStateChangedEvent" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.CanvasGroup" preserve="all" />
<type fullname="UnityEngine.CanvasRenderer" preserve="all" />
</assembly>
<assembly fullname="Sirenix.Serialization">
<type fullname="Sirenix.Serialization.SerializationData" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="UnityEngine.TextCoreFontEngineModule">
<type fullname="UnityEngine.TextCore.FaceInfo" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.TextCore.Glyph" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.TextCore.GlyphMetrics" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.TextCore.GlyphRect" preserve="nothing" serialized="true" />
</assembly>
</linker>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5a95af5ae3555cb4eaa7b93bb1f76a8a
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -27,7 +27,7 @@ MonoBehaviour:
intentionIconKeys: []
intentionValueNames: []
intentionTextOverride:
baseWeight: 1
baseWeight: 0
variableAttributes:
dictionaryList:
- Key: TargetCount
@@ -42,7 +42,7 @@ MonoBehaviour:
Value: 0
index: 2
isKeyDuplicated: 0
- Key: BuffStack
- Key: BuffStack_KnifeTrick
Value: 4
index: 3
isKeyDuplicated: 0

View File

@@ -11,10 +11,10 @@ namespace Continentis.Mods.Basic.Cards.Assassin
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
{
CommandGroup mainGroup = new CommandGroup(ExecutionMode.Sequential,
new Cmd_PlayAnimation(user.characterView, "Skill"),
new Cmd_PlayAnimation(user.characterView, "Action"),
new Cmd_Function(() =>
{
CreateCharacterBuff<Buffs.KnifeTrick>(GetAttribute("BuffStack")).Apply(user, user, this);
CreateCharacterBuff<Buffs.KnifeTrick>(GetAttribute("BuffStack_KnifeTrick")).Apply(user, user, this);
}));
return new List<CommandBase> { mainGroup };

View File

@@ -10,7 +10,7 @@ namespace Continentis.Mods.Basic.Buffs
public KnifeTrick(int stack)
{
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
this.contentSubmodule = new ContentSubmodule(this, false)
this.contentSubmodule = new ContentSubmodule(this)
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
this.iconSubmodule = new IconSubmodule(this);
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
@@ -20,8 +20,6 @@ namespace Continentis.Mods.Basic.Buffs
{
if (buff is Sharpness)
{
Debug.Log("Knife Trick observed Sharpness buff removal, adding new Sharpness buff.");
Debug.Log("Stack amount: " + unitedStackSubmodule.stackAmount);
CreateCharacterBuff<Sharpness>(unitedStackSubmodule.stackAmount).Apply(attachedCharacter, attachedCharacter);
}
}));
@@ -33,8 +31,6 @@ namespace Continentis.Mods.Basic.Buffs
if (FindExistingSameBuff(out existingBuff))
{
existingBuff.unitedStackSubmodule.ModifyStack(this.unitedStackSubmodule.stackAmount);
int newStack = existingBuff.unitedStackSubmodule.stackAmount;
existingBuff.coreAttributeSubmodule.numericChange["DodgeChanceOffset"] = newStack;
return false;
}
return true;

View File

@@ -152,7 +152,7 @@ MonoBehaviour:
index: 22
isKeyDuplicated: 0
- Key: Speed
Value: 99
Value: 0
index: 23
isKeyDuplicated: 0
- Key: LifeStealMultiplier

View File

@@ -122,7 +122,7 @@ namespace Continentis.MainGame
public void Remove()
{
buffIcon?.RemoveIcon();
//buffIcon?.RemoveIcon();
}
}

View File

@@ -105,6 +105,13 @@ namespace Continentis.MainGame.Character
public override void Remove()
{
OnBuffRemove();
if (iconSubmodule != null)
{
(attachedCharacter.characterView.hudContainer.enablingHUDs["CharacterBuffCollection"] as HUD_CharacterBuffCollection)
?.RemoveBuffIcon(this);
}
this.attachedCharacter.combatBuffSubmodule.buffList.Remove(this);
attachedCharacter.deckSubmodule.GetAllCards().ForEach(card => card.RefreshCardAttributes());
attachedCharacter.combatBuffSubmodule.buffList.Exclude(this).For(buff => buff.eventSubmodule?.onOtherBuffRemoved.Invoke(this));

View File

@@ -50,7 +50,7 @@ namespace Continentis.MainGame.UI
card.user = CombatMainManager.Instance.currentCharacter;
card.RefreshCardAttributes();
buttonText.text = "Team";
teamPileText.gameObject.SetActive(true);
UpdateTeamPileText(card.user.team);
});
}));
@@ -72,7 +72,7 @@ namespace Continentis.MainGame.UI
CombatUIManager.Instance.combatMainPage.ClearAllCardViews();
playerHero.deckSubmodule.SetUpHandCardViews();
buttonText.text = "Hero";
teamPileText.gameObject.SetActive(false);
UpdateTeamPileText(playerHero.team);
}));
seq.AppendInterval(0.1f);
seq.Append(CombatUIManager.Instance.combatMainPage.handPile.rectTransform.DOAnchorPosY(80f, 0.2f));
@@ -87,13 +87,17 @@ namespace Continentis.MainGame.UI
public void UpdateTeamPileText(CombatTeam team)
{
int currentCardCount = team.deckSubmodule.HandPile.Count;
Debug.Log($"Current team hand pile count: {currentCardCount}");
gameObject.SetActive(currentCardCount != 0);
if (isTeam)
{
gameObject.SetActive(true);
}
else
{
gameObject.SetActive(currentCardCount != 0);
}
teamPileText.text = $"{currentCardCount}/10";
Debug.Log($"Updated team pile text: {teamPileText.text}");
}
}
}

View File

@@ -34,8 +34,18 @@ namespace Continentis.MainGame.UI
HUD_CharacterBuffIcon buffIcon = buffIcons.Find(x => x.buff == buff);
if (buffIcon != null)
{
LeanPool.Despawn(buffIcon.gameObject);
buffIcons.Remove(buffIcon);
buff.iconSubmodule.buffIcon = null;
LeanPool.Despawn(buffIcon.gameObject);
}
else
{
// 如果逻辑上要移除 Buff但在 UI 列表里找不到对应的 Icon说明出事了。
// 这可能是导致你看到“Buff图标没有正常显示”的另一个原因状态不同步
Debug.LogWarning($"[HUD] 尝试移除 Buff {buff.contentSubmodule.displayName} 的图标,但在 buffIcons 列表中未找到匹配项!可能存在状态脱节。");
// 可选:强制清理一遍列表中的空引用(自我修复)
// CleanUpInvalidIcons();
}
UpdateHud();
}

View File

@@ -40,6 +40,14 @@ namespace Continentis.MainGame.UI
}
TMP_Text text = textList[textIndex];
if (text == null)
{
Debug.LogWarning($"Text component at index {textIndex} is null.");
// 如果这里触发了,说明上层逻辑在尝试操作一个已经死亡的 UI 对象
return;
}
if (getText != null)
{
text.gameObject.SetActive(true);