public static CallTimeObj AddTime(DelayCall call, float delayTime, MonoBehaviour mn = null, bool isUnique = false) { if (!inited) { inited = true; UpdateManager.AddCoroutine(null, 0, OnUpdate); } if (isUnique) { for (int i = 0; i < calltimes.size; i++) { CallTimeObj call2 = calltimes[i]; if (call2.mn == mn && call2.call == call) { return(call2); } } } var callobj = new CallTimeObj(); callobj.call = call; callobj.isMN = (mn != null); callobj.mn = mn; callobj.time = Time.realtimeSinceStartup + delayTime; calltimes.Add(callobj); return(callobj); }
/// <summary> /// 添加延迟执行按照帧数 call, delayframes, mn and isUnique. /// </summary> /// <param name='call'> /// 方法. /// </param> /// <param name='delayframes'> /// 延迟帧数. /// </param> /// <param name='mn'> /// 承载回掉函数的实例是否存在的判断. /// </param> /// <param name='isUnique'> /// 是否是唯一的方法. /// </param> public static CallObj Add(DelayCall call, int delayframes, MonoBehaviour mn = null, bool isUnique = false) { if (!inited) { inited = true; UpdateManager.AddCoroutine(null, 0, OnUpdate); } if (isUnique) { for (int i = 0; i < calls.size; i++) { CallObj call2 = calls[i]; if (call2.mn == mn && call2.call == call) { return(call2); } } } var callobj = new CallObj(); callobj.call = call; callobj.isMN = (mn != null); callobj.mn = mn; callobj.frame = counter + delayframes; calls.Add(callobj); return(callobj); //calls.Add(Time.frameCount+delayframes,call); //calls[Time.frameCount+delayframes]+=call; }
private void Start() { if (this.uiCamera == null) { this.uiCamera = NGUITools.FindCameraForLayer(base.gameObject.layer); } this.mTrans = base.transform; UpdateManager.AddCoroutine(this, this.updateOrder, new UpdateManager.OnUpdate(this.CoroutineUpdate)); }
private void Start() { if (uiCamera == null) { uiCamera = NGUITools.FindCameraForLayer(base.gameObject.layer); } mTrans = base.transform; UpdateManager.AddCoroutine(this, updateOrder, CoroutineUpdate); }
private void Start() { this.mTrans = base.transform; this.mRelative = this.mTrans.localPosition; if (this.ignoreTimeScale) { UpdateManager.AddCoroutine(this, this.updateOrder, new UpdateManager.OnUpdate(this.CoroutineUpdate)); } else { UpdateManager.AddLateUpdate(this, this.updateOrder, new UpdateManager.OnUpdate(this.CoroutineUpdate)); } }
private void Start() { mTrans = base.transform; mRelative = mTrans.localPosition; if (ignoreTimeScale) { UpdateManager.AddCoroutine(this, updateOrder, CoroutineUpdate); } else { UpdateManager.AddLateUpdate(this, updateOrder, CoroutineUpdate); } }
private void Start() { mTrans = transform; mRelative = mTrans.localRotation; mAbsolute = mTrans.rotation; if (ignoreTimeScale) { UpdateManager.AddCoroutine(this, updateOrder, CoroutineUpdate); } else { UpdateManager.AddLateUpdate(this, updateOrder, CoroutineUpdate); } }
private void Start() { UpdateManager.AddCoroutine(this, this.updateOrder, new UpdateManager.OnUpdate(this.CoroutineUpdate)); }
private void Start() { UpdateManager.AddCoroutine(this, updateOrder, CoroutineUpdate); }