示例#1
0
        public bool init()
        {
            m_pTargets = new Dictionary <CCObject, tHashElement>();
            CCScheduler.sharedScheduler().scheduleUpdateForTarget(this, 0, false);

            return(true);
        }
示例#2
0
 /// <summary>
 /// unschedules a custom selector.
 /// </summary>
 public void unschedule(SEL_SCHEDULE selector)
 {
     // explicit nil handling
     if (selector != null)
     {
         CCScheduler.sharedScheduler().unscheduleSelector(selector, this);
     }
 }
示例#3
0
        /** 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);
        }
示例#4
0
 /// <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;
 }
示例#5
0
 /// <summary>
 /// pauses all scheduled selectors and actions.
 /// Called internally by onExit
 /// </summary>
 public void pauseSchedulerAndActions()
 {
     CCScheduler.sharedScheduler().pauseTarget(this);
     CCActionManager.sharedManager().pauseTarget(this);
 }
示例#6
0
 /// <summary>
 /// resumes all scheduled selectors and actions.
 /// Called internally by onEnter
 /// </summary>
 public void resumeSchedulerAndActions()
 {
     CCScheduler.sharedScheduler().resumeTarget(this);
     CCActionManager.sharedManager().resumeTarget(this);
 }
示例#7
0
 /// <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);
 }
示例#8
0
 /// <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);
 }
示例#9
0
 /// <summary>
 ///  unschedules the "update" method.
 /// @since v0.99.3
 /// </summary>
 public void unscheduleUpdate()
 {
     CCScheduler.sharedScheduler().unscheduleUpdateForTarget(this);
 }
示例#10
0
 /// <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);
 }