Example #1
0
        public override void Tick(int deltaTimeMS)
        {
            if (!isSendFinished)
            {
                return;
            }

            if (isClosed)
            {
                return;
            }

            waitCD.Tick(deltaTimeMS);

            if (waitCD.IsRunning() && waitCD.IsFinish())
            {
                isClosed = true;
                PageMgr.ClosePage("UILoading");
                //this.fsmCtr.Stop();
                PageMgr.ShowPage <UIMainPage>();
                //var playerData = GlobalDataManager.GetInstance().playerData;
                ////存储当前场景ID
                //playerData.playerZoo.currSceneID = (fsmCtr as FSMGameLoad).sceneID;
            }
        }
Example #2
0
        public virtual void OnUpdate_NormalPlus()
        {
            if (dragType != DragType.NormalPlus || !CouldDrag())
            {
                return;
            }

            int deltaMS = Math_F.FloatToInt1000(Time.deltaTime);

            DragSmoothCD.Tick(deltaMS);
            if (!DragSmoothCD.IsFinish() && DragSmoothCD.IsRunning())
            {
                //LogWarp.LogErrorFormat("{0} OnUpdate_NormalPlus", Time.realtimeSinceStartup);
                //MessageString.Send((int)UFrameBuildinMessage.CameraDebug, Time.realtimeSinceStartup + " OnUpdate_NormalPlus");
                //滑动减速
                var deltaMove2D = dragSmoothDir * (float)DragSmoothCD.cd / (float)DragSmoothCD.org;
                dragMoveTo2D.x = cacheTrans.position.x + deltaMove2D.x;
                dragMoveTo2D.y = cacheTrans.position.z + deltaMove2D.y;
                if (CouldMoveTo(dragMoveTo2D))
                {
                    dragMoveTo.x        = cacheTrans.position.x + deltaMove2D.x;
                    dragMoveTo.z        = cacheTrans.position.z + deltaMove2D.y;
                    cacheTrans.position = dragMoveTo;
                }
            }
        }
        public virtual void TickTurn(int deltaTimeMS)
        {
            if (!turnCD.IsRunning() || turnCD.IsFinish())
            {
                return;
            }

            turnCD.Tick(deltaTimeMS);
            var ctr = this.ctrList[idxCtr];

            int left = turnCD.org - Mathf.Max(0, turnCD.cd);

            int logicDelta = deltaTimeMS;

            if (turnCD.cd < 0)
            {
                logicDelta += turnCD.cd;
            }
            //旋转
            this.ownerEntity.Rotate(new Vector3(0, ctr.turnSign * this.turnSpeed * logicDelta, 0), Space.Self);
            //位移
            var ctrForward = ctr.backPos - ctr.turnOrg;
            var turnDir    = Quaternion.Euler(0, ctr.turnSign * this.turnSpeed * left, 0) * ctrForward;

            this.ownerEntity.position = ctr.turnOrg + turnDir;

            if (turnCD.IsFinish())
            {
                turnCD.Stop();

                //去除tick旋转和位移的误差:位移到前点,看向下一个后点
                ownerEntity.position = ctr.forwardPos;
                idxCtr++;
                if (idxCtr < ctrList.Count)
                {
                    this.ownerEntity.LookAt(this.ctrList[idxCtr].backPos);
                    if (!isForward)
                    {
                        ownerEntity.Rotate(new Vector3(0, 180f, 0), Space.Self);
                    }
                }
            }
        }
 protected void TickCheckInCD(int deltaTimeMS)
 {
     checkInCD.Tick(deltaTimeMS);
     if (checkInCD.IsRunning())
     {
         if (checkInCD.IsFinish())
         {
             checkInCD.Stop();
             WhenCheckinCDFinished();
         }
     }
 }
Example #5
0
        /// <summary>
        /// CD递减
        /// </summary>
        /// <param name="deltaTimeMS"></param>
        public override void Tick(int deltaTimeMS)
        {
            if (!isRecvCDVal)
            {
                return;
            }
            if (GlobalDataManager.GetInstance().playerData.playerZoo.isGuide)
            {
                if (visitCDGameObject == null)
                {
                    GetSceneUIGameObject();
                }
            }
            checkInCD.Tick(deltaTimeMS);  // cd时间递减
#if UNITY_EDITOR && !NOVICEGUIDE
            if (visitCDGameObject == null)
            {
                string e = string.Format("visitCDGameObject == null");
                throw new System.Exception(e);
                //GetSceneUIGameObject();
            }
#endif
            accumulativeUpdateUITime += deltaTimeMS;
            if (!checkInCD.IsFinish() && accumulativeUpdateUITime >= maxUpdateUIDuration)
            {
                image_VisitCD.fillAmount = 1 - (float)checkInCD.cd / checkInCD.org;
                accumulativeUpdateUITime = 0;
            }

            if (!checkInCD.IsFinish() && this.shouldImmediateFinishEntryGateCheckInCD)
            {
                checkInCD.cd             = Math_F.FloatToInt1000(playerData.playerZoo.buffEntryGateCDVal);
                image_VisitCD.fillAmount = 1 - (float)checkInCD.cd / checkInCD.org;
                shouldImmediateFinishEntryGateCheckInCD = false;
            }

            //cd自己结束或者收到秒cd
            if (checkInCD.IsRunning() && checkInCD.IsFinish())
            {
                image_VisitCD.fillAmount             = 0;
                visitCDGameObject.transform.position = UFrame.Const.Invisible_Postion;
                //只有最新解锁的场景动物栏和大门产钱
                if (playerData.playerZoo.currSceneID == playerData.playerZoo.lastUnLockSceneID)
                {
                    GetFlutterTextGameObject();
                }
                checkInCD.Stop();
                WhenCDFinished();
            }
        }
        public override void Tick(int deltaTimeMS)
        {
            if (!isRevCDVal)
            {
                return;
            }

            visitCD.Tick(deltaTimeMS);  // cd时间递减

            if (GlobalDataManager.GetInstance().playerData.playerZoo.isGuide)
            {
                if (visitCDGameObject == null)
                {
                    GetSceneUIGameObject();
                }
            }

            if (!visitCD.IsFinish())
            {
                image_VisitCD.fillAmount = 1 - (float)visitCD.cd / visitCD.org;
            }

            if (!visitCD.IsFinish() && shouldImmediateFinishVisitCD)
            {
                visitCD.cd = Math_F.FloatToInt1000(playerData.playerZoo.buffVisitCDVal);
                image_VisitCD.fillAmount     = 1 - (float)visitCD.cd / visitCD.org;
                shouldImmediateFinishVisitCD = false;
            }

            //cd结束腾出观光位
            //是再次进入选动物栏状态,还是已经到最后一组准备离开
            if (visitCD.IsRunning() && visitCD.IsFinish())
            {
                image_VisitCD.fillAmount             = 0;
                visitCDGameObject.transform.position = UFrame.Const.Invisible_Postion;
                //只有最新解锁的场景动物栏和大门产钱
                if (playerData.playerZoo.currSceneID == playerData.playerZoo.lastUnLockSceneID)
                {
                    GetFlutterTextGameObject();
                }

                visitCD.Stop();
                WhenVisitCDFinished();
            }
        }
        protected void Tick_CD(int deltaTimeMs)
        {
            if (CD == null)
            {
                return;
            }
            int realCDVal = CD.org;

            CD.Tick(deltaTimeMs);
            if (CD.IsRunning() && CD.IsFinish())
            {
                if (CD.cd < 0)
                {
                    realCDVal += (-CD.cd);
                }
                CD.Reset();
                ZooAddCoin(realCDVal);
            }
        }