//-------------------------------------------------------------------------
        public void create(CRenderScene scene, CRenderTurret render_turret)
        {
            mScene = scene;
            mCRenderTurret = render_turret;
            int turret_id = render_turret.getTurretId();

            CTurretHelper turret_helper = mScene.getTurretHelper();

            float base_angle = turret_helper.getBaseAngleByTurretId(turret_id);

            mCSpriteCounter = new CSpriteCounter(mScene,
                turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().ChipsOffset),
                turret_helper.getBaseAngleByTurretId(turret_id));

            mScoreTurnplate = new CSpriteScoreTurnplate(mScene, turret_helper.getPositionByOffset(turret_id,
                mScene.getRenderConfigure().TurretTurnplateOffset), base_angle);

            //mCSpriteScore = new CSpriteScore(mScene, turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().ChipsOffset), 0, turret_id);

            if (turret_id == 0 || turret_id == 1)
            {
                EbVector3 offset = mScene.getRenderConfigure().TurretPanelScoreOffset;
                offset.x += mScene.getRenderConfigure().UpTurretPanelScoreOffset;
                //mCSpriteScore.setDigitPosition(turret_helper.getPositionByOffset(turret_id, offset), 0);
            }
            else
            {
                //mCSpriteScore.setDigitPosition(turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().TurretPanelScoreOffset), base_angle);
            }
            //mCSpriteScore.setBgPosition(turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().TurretPanelScoreBgOffset), base_angle);
        }
Exemple #2
0
        public void add(EbVector3 origin, EbVector3 gap, CRenderScene scene, CSpriteCounter._tScoreCountScruct score_count, float up_angle)
        {
            int index_null = mCSpriteHeaps.Length;

            for (int i = mCSpriteHeaps.Length - 1; i >= 0; --i)
            {
                if (mCSpriteHeaps[i] == null)
                {
                    index_null = i;
                }
                else
                {
                    break;
                }
            }

            if (index_null >= mCSpriteHeaps.Length)
            {
                return;
            }

            EbVector3 position = origin;

            position -= gap * index_null;

            mCSpriteHeaps[index_null] = new CSpriteHeap(scene, score_count.Number, score_count.Score, position, up_angle, getColor());
        }
Exemple #3
0
        //-------------------------------------------------------------------------
        public void create(CRenderScene scene, CRenderTurret render_turret)
        {
            mScene         = scene;
            mCRenderTurret = render_turret;
            int turret_id = render_turret.getTurretId();

            CTurretHelper turret_helper = mScene.getTurretHelper();

            float base_angle = turret_helper.getBaseAngleByTurretId(turret_id);

            mCSpriteCounter = new CSpriteCounter(mScene,
                                                 turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().ChipsOffset),
                                                 turret_helper.getBaseAngleByTurretId(turret_id));

            mScoreTurnplate = new CSpriteScoreTurnplate(mScene, turret_helper.getPositionByOffset(turret_id,
                                                                                                  mScene.getRenderConfigure().TurretTurnplateOffset), base_angle);

            //mCSpriteScore = new CSpriteScore(mScene, turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().ChipsOffset), 0, turret_id);

            if (turret_id == 0 || turret_id == 1)
            {
                EbVector3 offset = mScene.getRenderConfigure().TurretPanelScoreOffset;
                offset.x += mScene.getRenderConfigure().UpTurretPanelScoreOffset;
                //mCSpriteScore.setDigitPosition(turret_helper.getPositionByOffset(turret_id, offset), 0);
            }
            else
            {
                //mCSpriteScore.setDigitPosition(turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().TurretPanelScoreOffset), base_angle);
            }
            //mCSpriteScore.setBgPosition(turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().TurretPanelScoreBgOffset), base_angle);
        }
Exemple #4
0
        //-------------------------------------------------------------------------
        public void destroy()
        {
            //if (mCSpriteScore != null)
            //{
            //    mCSpriteScore.release();
            //    mCSpriteScore = null;
            //}

            if (mScoreTurnplate != null)
            {
                mScoreTurnplate.release();
                mScoreTurnplate = null;
            }

            if (mCSpriteCounter != null)
            {
                mCSpriteCounter.destroy();
                mCSpriteCounter = null;
            }

            mAimParticle = null;
        }
        //-------------------------------------------------------------------------
        public void destroy()
        {
            //if (mCSpriteScore != null)
            //{
            //    mCSpriteScore.release();
            //    mCSpriteScore = null;
            //}

            if (mScoreTurnplate != null)
            {
                mScoreTurnplate.release();
                mScoreTurnplate = null;
            }

            if (mCSpriteCounter != null)
            {
                mCSpriteCounter.destroy();
                mCSpriteCounter = null;
            }

            mAimParticle = null;
        }