Beispiel #1
0
 void Handle_CoinStackRollToHead(CoinStack cStack)
 {
     if (mCoinStacks.Count != 0 &&
         cStack.GetInstanceID() == mCoinStacks.Peek().GetInstanceID())
     {
         cStack.FadeOut();
     }
 }
Beispiel #2
0
        private float mCenterToCenterBetweenStack;  //币堆间的距离
        void Update()
        {
            //如果显示中的币堆少于限制数,则加入新币堆.
            if (mCoinStackDataToView.Count > 0 && mCoinStacks.Count < NumCoinStackLimit)
            {
                CoinStackDataToView csdtv = mCoinStackDataToView.Dequeue();
                PushOneStack(csdtv.coinNum, csdtv.fishOdd, csdtv.gunScore);
            }

            if (mState_IsMovingStacks)
            {
                if (mCoinStacks.Count == 0)
                {
                    goto TAG_BREAK_MOVINGSTACK;
                }

                if (mElapse_MovingStacks < TimeMoveUse)
                {
                    int       idx = 1;
                    Transform tsCoinStack;
                    foreach (CoinStack cs in mCoinStacks)
                    {
                        tsCoinStack = cs.transform;
                        tsCoinStack.localPosition = new Vector3(-mCenterToCenterBetweenStack * idx + mElapse_MovingStacks / TimeMoveUse * mCenterToCenterBetweenStack, 0F, tsCoinStack.localPosition.z);
                        ++idx;
                    }
                    //if (mElapse_MovingStacks == TimeMoveUse)
                    //{
                    //    break;
                    //}

                    //if (mElapse_MovingStacks > TimeMoveUse)
                    //    mElapse_MovingStacks = TimeMoveUse;


                    mElapse_MovingStacks += Time.deltaTime;
                }
                else//移动到目标位置
                {
                    int       idx = 1;
                    Transform tsCoinStack;
                    foreach (CoinStack cs in mCoinStacks)
                    {
                        tsCoinStack = cs.transform;
                        tsCoinStack.localPosition = new Vector3(-mCenterToCenterBetweenStack * idx + mCenterToCenterBetweenStack, 0F, tsCoinStack.localPosition.z);
                        ++idx;
                    }
                    CoinStack coinStackHead = mCoinStacks.Peek();
                    if (coinStackHead.IsRoleToHead)//如果最前面的还没有pileup到顶部,则不进行消失
                    {
                        coinStackHead.FadeOut();
                        mElapse_MovingStacks  = 0F;
                        mState_IsMovingStacks = false;
                    }
                }
                TAG_BREAK_MOVINGSTACK :;
            }
        }