Example #1
0
        public override void startWithTarget(CCNode pTarget)
        {
            base.startWithTarget(pTarget);

            CCGridBase newgrid = this.getGrid();

            CCNode     t          = m_pTarget;
            CCGridBase targetGrid = t.Grid;

            if (targetGrid != null && targetGrid.ReuseGrid > 0)
            {
                if (targetGrid.Active && targetGrid.GridSize.x == m_sGridSize.x &&
                    targetGrid.GridSize.y == m_sGridSize.y)
                {
                    targetGrid.reuse();
                }
            }
            else
            {
                if (targetGrid != null && targetGrid.Active)
                {
                    targetGrid.Active = false;
                }

                t.Grid        = newgrid;
                t.Grid.Active = true;
            }
        }
Example #2
0
        public override void startWithTarget(CCNode pTarget)
        {
            base.startWithTarget(pTarget);
            CCGridBase grid       = this.getGrid();
            CCNode     mPTarget   = this.m_pTarget;
            CCGridBase cCGridBase = mPTarget.Grid;

            if (cCGridBase == null || cCGridBase.ReuseGrid <= 0)
            {
                if (cCGridBase != null && cCGridBase.Active)
                {
                    cCGridBase.Active = false;
                }
                mPTarget.Grid        = grid;
                mPTarget.Grid.Active = true;
            }
            else if (cCGridBase.Active && cCGridBase.GridSize.x == this.m_sGridSize.x && cCGridBase.GridSize.y == this.m_sGridSize.y)
            {
                cCGridBase.reuse();
                return;
            }
        }