Exemplo n.º 1
0
 /// <summary>
 /// Stoping if is running. If you want lock runing forever, use <see cref="BreakForever"></see>/>
 /// </summary>
 public void Stop()
 {
     if (Mainer != null && Coroutine != null)
     {
         Mainer.StopCoroutine(Coroutine);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Run, it can be invoke only one time.
        /// </summary>
        /// <returns></returns>
        public bool Run()
        {
            if (HasStarted || IsBroken)
            {
                return(false);
            }
            HasStarted = true;
            if (Delay > TimeSpan.Zero)
            {
                Coroutine = Mainer.StartCoroutine(WaitAndInvoke());
            }
            else
            {
                WhenEnd();
            }

            return(true);
        }