using System.Collections.Generic; using System.Linq; using SLSFramework.General; using UniRx; using UnityEngine; namespace Continentis.MainGame.Card { public class ContentSubmodule : SubmoduleBase { public List keywords; public string cardName; public Sprite cardSprite; public Rarity cardRarity; public CardType cardType; public string originalFunctionText; public string interpretedFunctionText; /// /// 标记:内容已更改,需要刷新 /// public bool dirtyMark; public ContentSubmodule(CardInstance card) : base(card) { keywords = card.cardData.keywords; cardName = card.cardData.displayName.Localize(); cardSprite = card.cardData.cardSprite; originalFunctionText = card.cardData.functionText.Localize(); cardRarity = card.cardData.cardRarity; cardType = card.cardData.cardType; dirtyMark = false; Observable.EveryLateUpdate().Subscribe(_ => { if (dirtyMark) { RefreshContent(); dirtyMark = false; } }).AddTo(card.disposables); //CardDescriptionInterpreter.InterpretDescription(card); //keywords = CardDescriptionInterpreter.GetKeywords(card.cardData.cardDescription); //Debug.Log($"Extracted Keywords: {string.Join(", ", keywords)}"); } public void RefreshContent() { CardTextInterpreter.InterpretText(owner); owner.handCardView?.Setup(); owner.intentionCardView?.Setup(); } } }