Пример #1
0
        /// <summary>
        /// Add the transform of card to hand.
        /// Adjust the position of all hand cards.
        /// </summary>
        /// <param name="go"></param>
        public override void Add(UICard card)
        {
            Assert.IsTrue(Hands.Count < MAXSIZE);

            //UICard card = go.GetComponent<UICard>();
            GameObject go = card.gameObject;

            Hands.Add(card);
            int firstInd = GetFirstCardIndex();

            if (count % 2 == 1)
            {
                MultiAnimation moves = new MultiAnimation();
                for (int i = 0; i < count; ++i)
                {
                    Transform   targetPos = CardPos[firstInd + i];
                    LSAnimation move      = AnimationFactory.Instance.CreatMove(Hands[i].gameObject, targetPos);
                    go.transform.SetParent(transform);
                    moves.Add(move);
                }
                AnimationManager.Instance.AddAnimation(moves);
            }
            Transform   targetPos2 = CardPos[firstInd + count - 1];
            LSAnimation move2      = AnimationFactory.Instance.CreatMove(go, targetPos2);

            go.transform.SetParent(transform);
            AnimationManager.Instance.AddAnimation(move2);
        }
Пример #2
0
 public void AddAnimation(LSAnimation ani)
 {
     ani.callbacks.Add(AnimationFinish);
     m_anis.Enqueue(ani);
     if (m_state == State.Idle)
     {
         PlayAnimation();
     }
 }
Пример #3
0
        public void DrawCard(Card card)
        {
            GameObject  cardObject = PlayerDeck.GetNewCard(card);
            LSAnimation move1      = AnimationFactory.Instance.CreatMove(cardObject, RightShowTrans);

            AnimationManager.Instance.AddAnimation(move1);

            LSAnimation delay = AnimationFactory.Instance.CreatDelay(0.2f);

            AnimationManager.Instance.AddAnimation(delay);

            cardObject.AddComponent <HandDrag>();
            PlayerHand.Add(cardObject.GetComponent <UICard>());
        }
Пример #4
0
 private void PlayAnimation()
 {
     m_state      = State.Run;
     m_currentAni = m_anis.Dequeue();
     m_currentAni.Start();
 }
Пример #5
0
 public virtual void Add(LSAnimation ani)
 {
     subAnis.Add(ani);
     ani.callbacks.Add(SubFinish);
 }