コード例 #1
0
ファイル: VisualCardWrapper.cs プロジェクト: W3SS/Carty
 public VisualCardWrapper(GameObject card)
 {
     CardGO        = card;
     CanBeMoved    = card.GetComponent <CanBeMoved>();
     CanBeDetached = card.GetComponent <CanBeDetached>();
     CanBeInHand   = card.GetComponent <CanBeInHand>();
 }
コード例 #2
0
    void Start()
    {
        UpdateTime = 0;
        _card      = CardsGameObjects.DetachHandleWithHand(true);

        _hand        = Hand.CreateHand(true);
        _canbeinhand = _card.AddComponent <CanBeInHand>();

        _hand.Add(_canbeinhand);
    }
コード例 #3
0
        /// <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);
            }
        }
コード例 #4
0
ファイル: CanBeInHandAddToHand.cs プロジェクト: W3SS/Carty
    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);
    }
コード例 #5
0
    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);
    }
コード例 #6
0
ファイル: CanBeInHandUpdate.cs プロジェクト: W3SS/Carty
    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);
    }
コード例 #7
0
 /// <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);
 }
コード例 #8
0
 /// <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);
 }