private static void SetLongKeywordNatural(Card card, string str) { string[] longKeywordStrings = str.Split(';', ';'); var map = BIFStaticTool.GetEnumNameAndDescriptionSaved <ProxyEnum>(); foreach (var longKeywordString in longKeywordStrings) { string[] settings = longKeywordString.Split(':', ':'); if (settings.Length != 2) { continue; } CardProxyDelegate action = GetStaticDelegate(settings[1]); if (action == null) { Debug.LogWarning("[未找到委托函数]" + settings[1]); continue; } bool isFind = false; foreach (var item in map) { if (item.Value.Key.Equals(settings[0])) { var desc = GetProxyDescription(action); card.AddProxyOri(item.Key, action, desc.Item5, true); isFind = true; break; } } if (!isFind) { Debug.LogWarning("[未找到长关键字]" + card.name + settings[0] + action); } } }
public void SetByCard(Card card) { Init(); LockThis(false); setedCard = card; foreach (var trans in keywords) { trans.gameObject.SetActive(false); } foreach (var keyword in card.GetAllKeywords()) { string keywordName = BIFStaticTool.GetEnumDescriptionSaved(keyword); foreach (var trans in keywords) { if (keywordName == trans.name) { trans.gameObject.SetActive(true); } } } var map = BIFStaticTool.GetEnumNameAndDescriptionSaved <ProxyEnum>(); List <string> effects = new List <string>() { "闪电", "亡语", "光环" }; foreach (var pair in map) { if (effects.Count == 0) { break; } string description = pair.Value.Value; if (effects.Contains(description) && card.GetProxys(pair.Key) != null) { effects.Remove(description); if (description == "闪电") { 闪电.gameObject.SetActive(true); } else if (description == "亡语") { 亡语.gameObject.SetActive(true); } else if (description == "光环") { 光环.gameObject.SetActive(true); } } } if (card.isGold) { 嘲讽.sprite = 金色嘲讽; } else { 嘲讽.sprite = 普通嘲讽; } 金色边框.gameObject.SetActive(card.isGold); string name = BIFStaticTool.GetEnumDescriptionSaved(card.type); foreach (var spec in family) { if (name == spec.name) { spec.gameObject.SetActive(true); } else { spec.gameObject.SetActive(false); } } main.sprite = GameAnimationSetting.instance.Images.GetSpriteByString(card.image); #region set text and its color if (card.cardType != CardType.Spell) { Vector2Int body = card.GetMinionBody(); body.x = Math.Max(0, body.x); attackText.text = body.x.ToString(); healthText.text = body.y.ToString(); Vector2Int extraBody = card.GetExtraBody(); if (card.health < CardBuilder.GetCard(card.id).health) { SetHealthColor(Color.red); } else if (extraBody.y > 0) { SetHealthColor(Color.green); } else { SetHealthColor(Color.white); } if (extraBody.x > 0) { SetAttackColor(Color.green); } else { SetAttackColor(Color.white); } } if (card.cardType == CardType.Spell || card.cost > 0) { CostText.text = card.cost.ToString(); Cost.gameObject.SetActive(true); } else { Cost.gameObject.SetActive(false); } if (card.cardType == CardType.Spell) { attack.gameObject.SetActive(false); health.gameObject.SetActive(false); } else { attack.gameObject.SetActive(true); health.gameObject.SetActive(true); } #endregion if (潜行.gameObject.activeSelf) { //BIFStaticTool.SetAlphaRecursively(Content.gameObject, 0.5f); //BIFStaticTool.SetColorRecursively(Content.gameObject, new Color(1f, 1f, 1f, 0.5f)); BIFStaticTool.SetColorRecursively(Content.gameObject, new Color(0.5f, 0.5f, 0.5f, 1f)); } else { //BIFStaticTool.SetAlphaRecursively(Content.gameObject, 1f); BIFStaticTool.SetColorRecursively(Content.gameObject, new Color(1f, 1f, 1f, 1f)); } }