コード例 #1
0
ファイル: UnitData.cs プロジェクト: YYCatKnight/DieWorld
        public Timer_Logic RegTimer(Timer_Logic.TimerCall callBack, float waitTime = 1.0f, MonoBehaviour mo = null)
        {
            Timer_Logic logic = new Timer_Logic(callBack, waitTime, mo);

            mTimerStorage.RegTimer <Timer_Logic>(logic);
            return(logic);
        }
コード例 #2
0
 public void BeginTimer()
 {
     if (mTimerUpdate == null)
     {
         mTimerUpdate = Timer_Logic.SetTimer(TimerUpdate, 0, null);
     }
 }
コード例 #3
0
ファイル: FMotionGhost.cs プロジェクト: YYCatKnight/DieWorld
 private void OnDestroy()
 {
     if (mLogicEvent != null)
     {
         mLogicEvent.StopTimer();
         mLogicEvent = null;
     }
 }
コード例 #4
0
 private void StopTimer()
 {
     if (mTimer != null)
     {
         mTimer.StopTimer();
         mTimer = null;
     }
 }
コード例 #5
0
 public void Reset()
 {
     Clear();
     IsOver      = false;
     MaxNum      = 0;
     CurNum      = 0;
     mTimerLogic = null;
 }
コード例 #6
0
 public void Play()
 {
     if (IsOver || mTimerLogic == null)
     {
         IsOver      = false;
         mTimerLogic = Timer_Logic.SetTimer(PlayFun, 0, null);
     }
 }
コード例 #7
0
ファイル: FMotionGhost.cs プロジェクト: YYCatKnight/DieWorld
 void Start()
 {
     mHostPeople = this.GetComponent <FBasePeople>();
     if (mHostPeople.transform.parent == null)
     {
         Debug.LogError("FMotionGhost必须在一个父节点下");
     }
     mLogicEvent = Timer_Logic.SetTimer(UpdateGhost, 1, this);
 }
コード例 #8
0
        public void OnPointerDown(PointerEventData eventData)
        {
            IsSend = false;
            if (!mIsPress)
            {
                return;
            }

            StopTimer();
            mTimer = Timer_Logic.SetTimer(Press, mTime, this);
        }
コード例 #9
0
 public void CloseSocket()
 {
     if (mTimerUpdate != null)
     {
         mTimerUpdate.StopTimer();
         mTimerUpdate = null;
     }
     if (mMsgCore != null)
     {
         mMsgCore.Close();
     }
 }
コード例 #10
0
 private float Press(Timer_Logic timer)
 {
     IsSend = true;
     CallAction(timer.totalTime, true);
     if (!mCycle)
     {
         return(-1);
     }
     if (mTime == 0)
     {
         return(0);
     }
     return(mTime);
 }
コード例 #11
0
        public static void SwitchSprite(this Image sp, string name)
        {
            var spr = SceneManager.instance.CreateSprite(name);

            if (spr == null)
            {
                if (FEngine.mBackDown != null)
                {
                    if (name.Contains("UI2/BarracksSmall/"))
                    {
                        sp.sprite = SceneManager.instance.CreateSprite("Texture/null_BarracksSmall");
                    }
                    else if (name.Contains("UI2/Technology/"))
                    {
                        sp.sprite = SceneManager.instance.CreateSprite("Texture/Technology_0");
                        if (mMaxSpeed < 10)
                        {
                            mMaxSpeed++;
                            int idex  = 0;
                            var timer = Timer_Logic.SetTimer((t) =>
                            {
                                if (sp != null)
                                {
                                    idex++;
                                    if (idex > 2)
                                    {
                                        idex = 0;
                                    }
                                    sp.sprite = SceneManager.instance.CreateSprite("Texture/Technology_" + idex.ToString());
                                    return(0.3f);
                                }
                                else
                                {
                                    mMaxSpeed--;
                                    return(-1);
                                }
                            }, 1, null);
                        }
                    }
                    else
                    {
                        sp.sprite = SceneManager.instance.CreateSprite("Texture/null_null");
                    }
                }
            }
            else
            {
                sp.sprite = spr;
            }
        }
コード例 #12
0
 private float DelayUpdate(Timer_Logic le)
 {
     lock (mDelayAcions)
     {
         if (mDelayAcions.Count != 0)
         {
             for (int i = 0; i < mDelayAcions.Count; i++)
             {
                 ToolEventParams mult = mDelayAcions[i];
                 HandleEvent     eve  = _GetHandle(mult.GetName());
                 if (eve != null)
                 {
                     mult.CallBack(eve);
                 }
             }
             mDelayAcions.Clear();
         }
     }
     return(0);
 }
コード例 #13
0
 private float PlayFun(Timer_Logic logic)
 {
     if (mProgressTimers.Count < mMaxUse)
     {
         if (mTimers.Count > 0)
         {
             var timer = mTimers[0];
             mTimers.Remove(timer);
             mProgressTimers.Add(timer);
             timer._SetEndCallBack(FinishEvent);
             TimerController.SetYieldTimer(timer);
         }
         else if (mProgressTimers.Count == 0)
         {
             IsOver = true;
             return(-1);
         }
     }
     return(0);
 }
コード例 #14
0
 private float TimerUpdate(Timer_Logic le)
 {
     mMsgCore.FixedUpdate();
     return(0);
 }
コード例 #15
0
 protected override void OnInit()
 {
     Timer_Logic.SetTimer(DelayUpdate, 0, null);
 }
コード例 #16
0
ファイル: FMotionGhost.cs プロジェクト: YYCatKnight/DieWorld
 private float  UpdateGhost(Timer_Logic le)
 {
     CreateGhost();
     return(GhostFrequency);
 }