private static IEnumerator DelayInvokerOnEndOfFrameWorker(DelayFunction func, params object[] args) { yield return(ms_waitForEndOfFrame); try { func(args); } catch (Exception e) { string tempStr = string.Format("DelayInvoker DelayInvokerOnEndOfFrame() Error:{0}\n{1}", e.Message, e.StackTrace); Debuger.LogError(tempStr); } }
private void UnscaledDelayInvokeWorker(object group, float delay, DelayFunction func, params object[] args) { if (m_lstUnscaledHelper == null) { m_lstUnscaledHelper = new List <DelayHelper>(); } DelayHelper helper = new DelayHelper(); helper.group = group; helper.delay = delay; helper.func += func; helper.args = args; m_lstUnscaledHelper.Add(helper); }
private static IEnumerator DelayInvokerOnEndOfFrameWorker(DelayFunction func, params object[] args) { yield return(ms_waitForEndOfFrame); //Profiler.BeginSample("DelayInvoker_DelayInvokerOnEndOfFrame"); try { func(args); } catch (Exception e) { Debuger.LogError("DelayInvoker", "DelayInvokerOnEndOfFrame() Error:{0}\n{1}", e.Message, e.StackTrace); } //Profiler.EndSample(); }
private void Start() { _effectedMaterials = new List <Material>(); SetChildColliders(this.GetComponentsInChildren <Collider>()); SetChildBodies(this.GetComponentsInChildren <Rigidbody>()); SetAnimator(this.GetComponent <Animator>()); _delayGenerator = new DelayFunction(); _materialDelay = new DelayFunction(); SetStartPositions(); if (!isAI) { ReSpawn(controller.startPoint.position); } else { Spawn(); } }
public static void UnscaledDelayInvoke(float delay, DelayFunction func, params object[] args) { DelayInvoker.Instance.UnscaledDelayInvokeWorker(null, delay, func, args); }
public static void DelayInvoke(object group, float delay, DelayFunction func, params object[] args) { DelayInvoker.Instance.DelayInvokeWorker(group, delay, func, args); }
//==================================================================== public static void DelayInvokerOnEndOfFrame(DelayFunction func, params object[] args) { Instance.StartCoroutine(DelayInvokerOnEndOfFrameWorker(func, args)); }
private void Awake() { _animationDelayCreator = new DelayFunction(); _fallDelayCreator = new DelayFunction(); _animationDelayCreator.Delay(StartMoving, UnityEngine.Random.Range(0, variationTimer)); }
public DelayFunction AddDelayFunction(double delay, Action action) { var d = new DelayFunction(delay, action); return(d); }
private void Start() { variationDelay = new DelayFunction(); variationDelay.Delay(StartMove, Random.Range(0, variationTimer)); }