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); }
public void BeginTimer() { if (mTimerUpdate == null) { mTimerUpdate = Timer_Logic.SetTimer(TimerUpdate, 0, null); } }
private void OnDestroy() { if (mLogicEvent != null) { mLogicEvent.StopTimer(); mLogicEvent = null; } }
private void StopTimer() { if (mTimer != null) { mTimer.StopTimer(); mTimer = null; } }
public void Reset() { Clear(); IsOver = false; MaxNum = 0; CurNum = 0; mTimerLogic = null; }
public void Play() { if (IsOver || mTimerLogic == null) { IsOver = false; mTimerLogic = Timer_Logic.SetTimer(PlayFun, 0, null); } }
void Start() { mHostPeople = this.GetComponent <FBasePeople>(); if (mHostPeople.transform.parent == null) { Debug.LogError("FMotionGhost必须在一个父节点下"); } mLogicEvent = Timer_Logic.SetTimer(UpdateGhost, 1, this); }
public void OnPointerDown(PointerEventData eventData) { IsSend = false; if (!mIsPress) { return; } StopTimer(); mTimer = Timer_Logic.SetTimer(Press, mTime, this); }
public void CloseSocket() { if (mTimerUpdate != null) { mTimerUpdate.StopTimer(); mTimerUpdate = null; } if (mMsgCore != null) { mMsgCore.Close(); } }
private float Press(Timer_Logic timer) { IsSend = true; CallAction(timer.totalTime, true); if (!mCycle) { return(-1); } if (mTime == 0) { return(0); } return(mTime); }
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; } }
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); }
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); }
private float TimerUpdate(Timer_Logic le) { mMsgCore.FixedUpdate(); return(0); }
protected override void OnInit() { Timer_Logic.SetTimer(DelayUpdate, 0, null); }
private float UpdateGhost(Timer_Logic le) { CreateGhost(); return(GhostFrequency); }