public override void Setup(IBattleActionElement element) { RankCellsRestriction rankRestriction = element as RankCellsRestriction; string spriteName = GetSpriteName(rankRestriction); image.sprite = SpriteManager.Instance.GetSpriteByName(spriteName); }
/// <summary> /// Show iconography and information about the given action node. /// </summary> public virtual void Setup(IBattleActionElement element) { if (image != null) { image.sprite = SpriteManager.Instance.GetSpriteByName(element.name); } }
public BattleActionElementDisplay GetDisplay(IBattleActionElement element) { // If there is a display for the given element, make it! BattleActionElementDisplay prefab = GetPrefab(element); if (prefab != null) { BattleActionElementDisplay instance = Instantiate(prefab); instance.Setup(element); return(instance); } // No applicable display - give em nutin! return(null); }
public override void Setup(IBattleActionElement element) { FormationRestriction formationRestriction = element as FormationRestriction; TargetableFormation formations = formationRestriction.Formations; if (formations.HasFlag(TargetableFormation.Other) && !formations.HasFlag(TargetableFormation.Self)) { image.color = otherColour; } else if (formations.HasFlag(TargetableFormation.Self) && !formations.HasFlag(TargetableFormation.Other)) { image.color = selfColour; } }
public override void Setup(IBattleActionElement element) { // By default, hide all the bits ShowAll(false); CellContentRestriction cellRestriction = element as CellContentRestriction; TargetableCellContent content = cellRestriction.Content; // Everything! if (content.HasFlag(TargetableCellContent.All)) { all.SetActive(true); } else { // Allies if (content.HasFlag(TargetableCellContent.Ally)) { ally.SetActive(true); } // Enemies if (content.HasFlag(TargetableCellContent.Enemy)) { enemy.SetActive(true); } // Self if (content.HasFlag(TargetableCellContent.Self)) { self.SetActive(true); } } // Empty cells? if (content.HasFlag(TargetableCellContent.All) || content.HasFlag(TargetableCellContent.Empty)) { empty.SetActive(true); } }
public override void Setup(IBattleActionElement element) { HealthRestriction manaRestriction = element as HealthRestriction; text.text = manaRestriction.Amount.ToString(); }
public override void Setup(IBattleActionElement element) { ApplyStatusNode node = element as ApplyStatusNode; image.sprite = SpriteManager.Instance.GetSpriteByName(node.Status.Name); }
public override void Setup(IBattleActionElement element) { RangeRestriction rangeRestriction = element as RangeRestriction; text.text = rangeRestriction.Range.ToString(); }
public override void Setup(IBattleActionElement element) { DoDamageNode damageNode = element as DoDamageNode; amountText.text = damageNode.BaseDamage.ToString(); }
private BattleActionElementDisplay GetPrefab(IBattleActionElement element) { return(Prefabs.FirstOrDefault(p => element.name.Contains(p.DisplaysFor))); }
public override void Setup(IBattleActionElement element) { HealNode healNode = element as HealNode; amountText.text = healNode.Amount.ToString(); }