Exemplo n.º 1
0
        public static CCActionManager sharedManager()
        {
            CCActionManager manager = g_sharedActionManager;

            if (manager == null)
            {
                manager = g_sharedActionManager = new CCActionManager();
                if (!g_sharedActionManager.init())
                {
                    manager = (CCActionManager)(g_sharedActionManager = null);
                }
            }
            return(manager);
        }
Exemplo n.º 2
0
        /// <summary>
        /// returns a shared instance of the CCActionManager
        /// </summary>
        public static CCActionManager sharedManager()
        {
            CCActionManager ret = g_sharedActionManager;

            if (ret == null)
            {
                ret = g_sharedActionManager = new CCActionManager();

                if (!g_sharedActionManager.init())
                {
                    ret = g_sharedActionManager = null;
                }
            }

            return(ret);
        }
        /** returns a shared instance of the CCActionManager */
        public static CCActionManager sharedManager()
        {
            CCActionManager ret = g_sharedActionManager;

            if (ret == null)
            {
                ret = g_sharedActionManager = new CCActionManager();

                if (!g_sharedActionManager.init())
                {
                    ret = g_sharedActionManager = null;
                }
            }

            return ret;
        }
Exemplo n.º 4
0
 public void purgeSharedManager()
 {
     CCScheduler.sharedScheduler().unscheduleAllSelectorsForTarget(this);
     g_sharedActionManager = null;
 }
Exemplo n.º 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);
 }
Exemplo n.º 6
0
 public CCAction runAction(CCAction action)
 {
     CCActionManager.sharedManager().addAction(action, this, !this.m_bIsRunning);
     return(action);
 }
Exemplo n.º 7
0
 /// <summary>
 /// resumes all scheduled selectors and actions.
 /// Called internally by onEnter
 /// </summary>
 public void resumeSchedulerAndActions()
 {
     CCScheduler.sharedScheduler().resumeTarget(this);
     CCActionManager.sharedManager().resumeTarget(this);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Removes an action from the running action list given its tag
 /// @since v0.7.1
 /// </summary>
 public void StopActionByTag(int tag)
 {
     Debug.Assert(tag != (int)NodeTag.kCCNodeTagInvalid, "Invalid tag");
     CCActionManager.sharedManager().removeActionByTag(tag, this);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Gets an action from the running action list given its tag
 /// </summary>
 /// <returns>the Action the with the given tag</returns>
 public CCAction GetActionByTag(int tag)
 {
     Debug.Assert((int)tag != (int)NodeTag.kCCNodeTagInvalid, "Invalid tag");
     return(CCActionManager.sharedManager().getActionByTag((uint)tag, this));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Removes all actions from the running action list
 /// </summary>
 public void StopAllActions()
 {
     CCActionManager.sharedManager().removeAllActionsFromTarget(this);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Removes an action from the running action list
 /// </summary>
 public void StopAction(CCAction action)
 {
     CCActionManager.sharedManager().removeAction(action);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Executes an action, and returns the action that is executed.
 /// The node becomes the action's target.
 /// @warning Starting from v0.8 actions don't retain their target anymore.
 /// @return
 /// </summary>
 /// <returns>An Action pointer</returns>
 public CCAction RunAction(CCAction action)
 {
     Debug.Assert(action != null, "Argument must be non-nil");
     CCActionManager.sharedManager().addAction(action, this, !IsRunning);
     return(action);
 }
Exemplo n.º 13
0
        public CCNode()
        {
            m_fScaleX = 1.0f;
            m_fScaleY = 1.0f;
            m_bIsVisible = true;
            m_nTag = kCCNodeTagInvalid;

            m_tTransform = CCAffineTransform.Identity;
            m_bIsInverseDirty = true;

            // set default scheduler and actionManager
            CCDirector director = CCDirector.SharedDirector;
            m_pActionManager = director.ActionManager;
            m_pScheduler = director.Scheduler;
        }
Exemplo n.º 14
0
 public void stopActionByTag(int tag)
 {
     CCActionManager.sharedManager().removeActionByTag(tag, this);
 }
Exemplo n.º 15
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;
 }
Exemplo n.º 16
0
 /// <summary>
 /// Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays).
 /// Composable actions are counted as 1 action. Example:
 /// If you are running 1 Sequence of 7 actions, it will return 1.
 /// If you are running 7 Sequences of 2 actions, it will return 7.
 /// </summary>
 public uint NumberOfRunningActions()
 {
     return(CCActionManager.sharedManager().numberOfRunningActionsInTarget(this));
 }
Exemplo n.º 17
0
        public virtual bool Init()
        {
            // scenes
            m_pRunningScene = null;
            m_pNextScene = null;

            m_pNotificationNode = null;

            m_dOldAnimationInterval = m_dAnimationInterval = 1.0 / kDefaultFPS;

            // Set default projection (3D)
            m_eProjection = ccDirectorProjection.kCCDirectorProjectionDefault;

            // projection delegate if "Custom" projection is used
            m_pProjectionDelegate = null;

            // FPS
            m_fAccumDt = 0.0f;
            m_fFrameRate = 0.0f;
            m_pFPSLabel = null;
            m_pSPFLabel = null;
            m_pDrawsLabel = null;
            m_bDisplayStats = false;
            m_uTotalFrames = m_uFrames = 0;

            // paused ?
            m_bPaused = false;

            // purge ?
            m_bPurgeDirecotorInNextLoop = false;

            m_obWinSizeInPixels = m_obWinSizeInPoints = CCSize.Zero;

            //m_pobOpenGLView = null;

            m_fContentScaleFactor = 1.0f;

            // scheduler
            m_pScheduler = new CCScheduler();
            // action manager
            m_pActionManager = new CCActionManager();
            m_pScheduler.ScheduleUpdateForTarget(m_pActionManager, CCScheduler.kCCPrioritySystem, false);
            // touchDispatcher
            m_pTouchDispatcher = new CCTouchDispatcher();
            m_pTouchDispatcher.Init();

            // KeypadDispatcher
            m_pKeypadDispatcher = new CCKeypadDispatcher();

            // Accelerometer
            #if !PSM &&!NETFX_CORE
            m_pAccelerometer = new CCAccelerometer();
            #endif
            // create autorelease pool
            //CCPoolManager::sharedPoolManager()->push();

            m_NeedsInit = false;
            return true;
        }
Exemplo n.º 18
0
 public CCAction getActionByTag(int tag)
 {
     return(CCActionManager.sharedManager().getActionByTag((uint)tag, this));
 }