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

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