public VisualCardWrapper(GameObject card) { CardGO = card; CanBeMoved = card.GetComponent <CanBeMoved>(); CanBeDetached = card.GetComponent <CanBeDetached>(); CanBeInHand = card.GetComponent <CanBeInHand>(); }
void Start() { UpdateTime = 0; _card = CardsGameObjects.DetachHandleWithHand(true); _hand = Hand.CreateHand(true); _canbeinhand = _card.AddComponent <CanBeInHand>(); _hand.Add(_canbeinhand); }
/// <summary> /// Remove a card from hand. /// Will update all remaining cards transforms. /// </summary> /// <param name="card">Card to be removed.</param> public void Remove(CanBeInHand card) { Cards.Remove(card); card.RemovedFromHand(); for (int i = 0; i < Cards.Count; i++) { Cards[i].OnIndexChanged(i, Cards.Count); } }
void Start() { UpdateTime = 0; _card = CardsGameObjects.OnlyDetachHandle(); _card.AddComponent <CanBeDetached>(); _card.AddComponent <CanBeMoved>(); var owned = _card.AddComponent <CanBeOwned>(); owned.PlayerOwned = true; _hand = Hand.CreateHand(true); _canbeinhand = _card.AddComponent <CanBeInHand>(); _canbeinhand.AddedToHand(0, 1, _hand); IntegrationTest.Assert(_canbeinhand.IsInHand == true); }
void Start() { UpdateTime = 0; _card = CardsGameObjects.OnlyDetachHandle(); _card.AddComponent <CanBeDetached>(); _card.AddComponent <CanBeMoved>(); var owned = _card.AddComponent <CanBeOwned>(); owned.PlayerOwned = true; _hand = _card.AddComponent <CanBeInHand>(); _card.transform.position = Vector3.zero; _card.transform.rotation = Quaternion.identity; _hand.OnIndexChanged(1, 2); }
void Start() { UpdateTime = 0; _card = CardsGameObjects.OnlyDetachHandle(); _card.AddComponent <CanBeDetached>(); _card.AddComponent <CanBeMoved>(); var owned = _card.AddComponent <CanBeOwned>(); owned.PlayerOwned = true; _hand = _card.AddComponent <CanBeInHand>(); _card.transform.position = VisualManager.Instance.HandPositioning.PositionPlayer(0, 1); _card.transform.rotation = VisualManager.Instance.HandPositioning.RotationPlayer(0, 1); _hand.IsInHand = true; _hand.OnIndexChanged(1, 2); }
/// <summary> /// Adds a card into the hand but don't move and rotate it. /// Does not update already present cards, use PrepareAddingCard for that. /// </summary> /// <param name="card">Card to be added.</param> public void AddWithoutFitting(CanBeInHand card) { card.AddedToHandWithoutFitting(this); Cards.Add(card); }
/// <summary> /// Adds a card into the hand. /// Does not update already present cards, use PrepareAddingCard for that. /// Will move and rotate the card to have a correct transform. /// </summary> /// <param name="card">Card to be added.</param> public void Add(CanBeInHand card) { card.AddedToHand(Cards.Count, Cards.Count + 1, this); Cards.Add(card); }