public override void SetInfo() { base.SetInfo(); _abilityOwner = GameAction.Parameters[0]; _usedAbility = GameAction.Parameters[1] as AbilityData; _abilityValue = (int)GameAction.Parameters[2]; _abilityUsedOnPlayer = GameAction.Parameters[3] as Player; switch (_abilityOwner) { case BoardUnit unit: PreviewImage.sprite = unit.Sprite; _healCreatureObj = CreateCardPreview(unit.Card, Vector3.zero); break; case BoardSpell spell: { string rarity = Enum.GetName(typeof(Enumerators.CardRank), spell.Card.LibraryCard.CardRank); string cardSetName = CardsController.GetSetOfCard(spell.Card.LibraryCard); PreviewImage.sprite = LoadObjectsManager.GetObjectByPath <Sprite>( string.Format("Images/Cards/Illustrations/{0}_{1}_{2}", cardSetName.ToLower(), rarity.ToLower(), spell.Card.LibraryCard.Picture.ToLower())); _healCreatureObj = CreateCardPreview(spell.Card, Vector3.zero); break; } } HealPictureObject.SetActive(true); _healedPlayerObj = CreatePlayerPreview(_abilityUsedOnPlayer, Vector3.right * 6); GameObject attackViewPlayer = _healedPlayerObj.transform.Find("AttackingHealth").gameObject; attackViewPlayer.SetActive(true); TextMeshPro damageText = attackViewPlayer.transform.Find("AttackText").GetComponent <TextMeshPro>(); damageText.text = _abilityValue.ToString(); attackViewPlayer.transform.localPosition = Vector3.up * -0.86f; }
public override void SetInfo() { base.SetInfo(); _callerPlayer = GameAction.Parameters[0] as Player; _usedSkill = GameAction.Parameters[1] as HeroSkill; _skillUsedOnPlayer = GameAction.Parameters[2] as Player; PreviewImage.sprite = LoadObjectsManager.GetObjectByPath <Sprite>("Images/Heroes/CZB_2D_Hero_Portrait_" + _callerPlayer.SelfHero.HeroElement + "_EXP"); HealPictureObject.SetActive(true); _healPlayerObj = CreatePlayerPreview(_callerPlayer, Vector3.zero); _healedPlayerObj = CreatePlayerPreview(_skillUsedOnPlayer, Vector3.right * 6); GameObject cardView = _healedPlayerObj.transform.Find("AttackingHealth").gameObject; cardView.SetActive(true); TextMeshPro damageText = cardView.transform.Find("AttackText").GetComponent <TextMeshPro>(); damageText.text = _usedSkill.Value.ToString(); cardView.transform.localPosition = -Vector3.up; }