示例#1
0
 private bool UpdateTime(float deltaMillisec)
 {
     if (delayFrame > 0)
     {
         --delayFrame;
         return(true);
     }
     else if (delayRoutine != null)
     {
         if (delayRoutine.IsComplete)
         {
             delayRoutine = null;
         }
         else
         {
             return(true);
         }
     }
     else
     {
         if (firstRun)
         {
             firstRun = false;
         }
         else
         {
             delayMillisec = Mathf.Max(0f, delayMillisec - deltaMillisec);
         }
     }
     return(false);
 }
示例#2
0
        private GWait CastWaitOrder(object returnObject)
        {
            GWait waitOrder = null;

            if (returnObject == null)
            {
                waitOrder = new GWait(GTimeUnit.Frame, 1);
            }
            else
            {
                if (returnObject is GWait)
                {
                    waitOrder = (GWait)returnObject;
                }
                else if (returnObject is IEnumerator)
                {
                    IEnumerator coroutine     = (IEnumerator)returnObject;
                    GRoutine    targetRoutine = ownerCore.AddGRoutine(coroutine);
                    delayRoutine = targetRoutine;
                }
                else if (routine.Current is GRoutine)
                {
                    GRoutine targetRoutine = (GRoutine)returnObject;
                    delayRoutine = targetRoutine;
                }
                else
                {
                    GDebug.Log("지원되지 않는 반환 형식입니다. 'GWait', 'GRoutine', 'IEnumerator' 클래스를 반환하세요.", GLogLevel.Error);
                    waitOrder = new GWait(GTimeUnit.Frame, 1);
                }
            }
            return(waitOrder);
        }
示例#3
0
        public void Start()
        {
            if (IsRunning)
            {
                return;
            }

            routine = ownerCore.AddGRoutine(ScheduleUpdate());
        }
示例#4
0
        public void Stop()
        {
            if (!IsRunning)
            {
                return;
            }

            ownerCore.RemoveGRoutine(routine);
            routine = null;
        }