Beispiel #1
0
 /// <summary>
 /// Init
 /// </summary>
 /// <param name="trate"></param>
 public void Init(BattleTrate trate)
 {
     Trate = trate;
     DescriptionText.text = "Card Trate";
     NameText.text        = Trate.SourceTrate.name;
     ArtworkImage.sprite  = Trate.SourceTrate.Artwork;
     ManaText.text        = Trate.Mana.ToString();
     AttackText.text      = Trate.Attack.ToString();
     HealthText.text      = Trate.Health.ToString();
     DefenceText.text     = Trate.Defence.ToString();
 }
Beispiel #2
0
        /// <summary>
        /// Add trate to hand
        /// </summary>
        /// <param name="battleTrate"></param>
        /// <param name="side"></param>
        public void AddTrateToDeck(BattleTrate battleTrate, BattleSide side)
        {
            // Load Card
            var trateGameObject = (GameObject)Instantiate(
                Resources.Load("Prefabs/Trate", typeof(GameObject)), new Vector3(), Quaternion.identity,
                _pull.transform
                );

            // Set Z was zero position
            trateGameObject.transform.localPosition = new Vector3(trateGameObject.transform.localRotation.x,
                                                                  trateGameObject.transform.localRotation.y, 0);
            // Init Trate
            var trateView = trateGameObject.GetComponent <TrateView>();

//            trateView.CanDroppable = false;
            trateView.Side = side;
            trateView.MainParenTransform = _placeholderParenTransform;
            trateView.PlaceholderParent  = _handTransform;
            trateView.Init(battleTrate);
            trateView.CreatePlaceholder();
            trateGameObject.SetActive(false);
            InitDeckCount();
        }