public void ManualStop()
 {
     if (co != null)
     {
         CoRef.StopCoroutineAway(co);
     }
 }
 private void OnDisable()
 {
     if (co != null)
     {
         CoRef.StopCoroutineAway(co);
     }
 }
 private void Start()
 {
     if (CountOnStart)
     {
         co = CoRef.StartCoroutineAway(InvokeAfterCO(secounds));
     }
 }
 private void OnEnable()
 {
     if (CountOnEnable)
     {
         co = CoRef.StartCoroutineAway(InvokeAfterCO(secounds));
     }
 }
Beispiel #5
0
 public static void CreateCorotineReferance()
 {
     if (!instance)
     {
         GameObject gameObject = new GameObject("GameEventCorotuineStarter");
         instance = gameObject.AddComponent <CoRef>();
     }
 }
Beispiel #6
0
 private void Awake()
 {
     if (!instance)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this);
     }
 }
 public void ManualStart(float secounds)
 {
     ManualStop();
     co = CoRef.StartCoroutineAway(InvokeAfterCO(secounds));
 }
Beispiel #8
0
 public static Coroutine InvokeAfterDelay(float delay, Action callback)
 {
     return(CoRef.StartCoroutineAway(_WaitForSeconds(delay, callback)));
 }
Beispiel #9
0
 public static void Stop(Coroutine co)
 {
     CoRef.StopCoroutineAway(co);
 }
Beispiel #10
0
 public static Coroutine InvokeWhen(Action callback, Func <bool> predect)
 {
     return(CoRef.StartCoroutineAway(_WaitUntil(callback, predect)));
 }
Beispiel #11
0
 public static Coroutine InvokeEndOfFrame(Action callback)
 {
     return(CoRef.StartCoroutineAway(_WaitForEndOfFrame(callback)));
 }