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);
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
 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();
     }
 }
Esempio n. 5
0
 public static void UnscaledDelayInvoke(float delay, DelayFunction func, params object[] args)
 {
     DelayInvoker.Instance.UnscaledDelayInvokeWorker(null, delay, func, args);
 }
Esempio n. 6
0
 public static void DelayInvoke(object group, float delay, DelayFunction func, params object[] args)
 {
     DelayInvoker.Instance.DelayInvokeWorker(group, delay, func, args);
 }
Esempio n. 7
0
        //====================================================================

        public static void DelayInvokerOnEndOfFrame(DelayFunction func, params object[] args)
        {
            Instance.StartCoroutine(DelayInvokerOnEndOfFrameWorker(func, args));
        }
Esempio n. 8
0
 private void Awake()
 {
     _animationDelayCreator = new DelayFunction();
     _fallDelayCreator      = new DelayFunction();
     _animationDelayCreator.Delay(StartMoving, UnityEngine.Random.Range(0, variationTimer));
 }
Esempio n. 9
0
    public DelayFunction AddDelayFunction(double delay, Action action)
    {
        var d = new DelayFunction(delay, action);

        return(d);
    }
Esempio n. 10
0
 private void Start()
 {
     variationDelay = new DelayFunction();
     variationDelay.Delay(StartMove, Random.Range(0, variationTimer));
 }