Ejemplo n.º 1
0
        //Function called externally to start a timer with a designated action
        public static JUCLTimer Create(Action action, float timer, string timerName = null)
        {
            InitIfNeeded();
            GameObject gameObject = new GameObject("JUCL timer", typeof(MonoBehaviourHook));
            JUCLTimer  juclTimer  = new JUCLTimer(action, timer, timerName, gameObject);

            gameObject.GetComponent <MonoBehaviourHook>().onUpdate = juclTimer.Update;

            activeTimerList.Add(juclTimer);
            return(juclTimer);
        }
Ejemplo n.º 2
0
 //Removes the timer
 private static void RemoveTimer(JUCLTimer timer)
 {
     InitIfNeeded();
     activeTimerList.Remove(timer);
 }