public bool init() { m_pTargets = new Dictionary <CCObject, tHashElement>(); CCScheduler.sharedScheduler().scheduleUpdateForTarget(this, 0, false); return(true); }
/// <summary> /// unschedules a custom selector. /// </summary> public void unschedule(SEL_SCHEDULE selector) { // explicit nil handling if (selector != null) { CCScheduler.sharedScheduler().unscheduleSelector(selector, this); } }
/** returns a shared instance of the Scheduler */ public static CCScheduler sharedScheduler() { if (g_sharedScheduler == null) { g_sharedScheduler = new CCScheduler(); g_sharedScheduler.init(); } return(g_sharedScheduler); }
/// <summary> /// purges the shared action manager. It releases the retained instance. /// because it uses this, so it can not be static /// @since v0.99.0 /// </summary> public void purgeSharedManager() { CCScheduler.sharedScheduler().unscheduleAllSelectorsForTarget(this); g_sharedActionManager = null; }
/// <summary> /// pauses all scheduled selectors and actions. /// Called internally by onExit /// </summary> public void pauseSchedulerAndActions() { CCScheduler.sharedScheduler().pauseTarget(this); CCActionManager.sharedManager().pauseTarget(this); }
/// <summary> /// resumes all scheduled selectors and actions. /// Called internally by onEnter /// </summary> public void resumeSchedulerAndActions() { CCScheduler.sharedScheduler().resumeTarget(this); CCActionManager.sharedManager().resumeTarget(this); }
/// <summary> /// unschedule all scheduled selectors: custom selectors, and the 'update' selector. /// Actions are not affected by this method. /// @since v0.99.3 /// </summary> public void unscheduleAllSelectors() { CCScheduler.sharedScheduler().unscheduleAllSelectorsForTarget(this); }
/// <summary> /// schedules a custom selector with an interval time in seconds. ///If time is 0 it will be ticked every frame. ///If time is 0, it is recommended to use 'scheduleUpdate' instead. ///If the selector is already scheduled, then the interval parameter ///will be updated without scheduling it again. /// </summary> public void schedule(SEL_SCHEDULE selector, float interval) { CCScheduler.sharedScheduler().scheduleSelector(selector, this, interval, !m_bIsRunning); }
/// <summary> /// unschedules the "update" method. /// @since v0.99.3 /// </summary> public void unscheduleUpdate() { CCScheduler.sharedScheduler().unscheduleUpdateForTarget(this); }
/// <summary> /// schedules the "update" selector with a custom priority. This selector will be called every frame. /// Scheduled selectors with a lower priority will be called before the ones that have a higher value. /// Only one "update" selector could be scheduled per node (You can't have 2 'update' selectors). /// @since v0.99.3 /// </summary> /// <param name="priority"></param> public void scheduleUpdateWithPriority(int priority) { CCScheduler.sharedScheduler().scheduleUpdateForTarget(this, priority, !m_bIsRunning); }