Exemplo n.º 1
0
        /// <summary>
        /// Sets the update routine for the object and update phase.
        /// </summary>
        static public Routine SetUpdateRoutineGenerator(this MonoBehaviour inHost, Func <IEnumerator> inUpdateFunc, RoutinePhase inPhase = RoutinePhase.Update)
        {
            string  phaseName = GetPhaseUpdaterName(inPhase);
            Routine routine   = Routine.Find(inHost, phaseName).Replace(Routine.StartLoopRoutine(inHost, inUpdateFunc)).SetPhase(inPhase);
            Fiber   fiber     = Manager.Get().Fibers[routine];

            if (fiber != null)
            {
                fiber.SetNameUnchecked(phaseName);
            }
            return(routine);
        }