Esempio n. 1
0
        //-------------------------------------------------------------------------
        public void create(int turret_id, ref _tScenePlayer scene_player, int player_gold,
                           bool buffer_power, bool buffer_freeze, bool buffer_longpress, bool buffer_rapid, int turret_rate, float turret_angle, int locked_fish_objid
                           , TbDataTurret.TurretType turret_type)
        {
            mTurretId    = turret_id;
            mPlayer      = scene_player;
            mTurretAngle = turret_angle;

            mTurretType      = turret_type;
            mTurretDataTable = new TurretDataTable();

            _setTurretRate(turret_rate);

            CTurretHelper turret_helper = mScene.getTurretHelper();

            mTurretPos = turret_helper.getPositionByOffset(turret_id,
                                                           mScene.getRenderConfigure().TurretOffset);
            mBaseAngle   = turret_helper.getBaseAngleByTurretId(turret_id);
            mTurretColor = turret_helper.getBaseColorByTurretId(turret_id).convert();

            float scene_length = mScene.getSceneLength();
            float scene_width  = mScene.getSceneWidth();

            mCSpriteTurretShow = new CSpriteTurretShow();
            mCSpriteTurretShow.create(mScene, this);

            _displayTurretRate();

            mRenderBufferMgr = new CRenderBufferMgr(mScene, this,
                                                    turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().TurretBufferOffset), mBaseAngle);
            setLockFishByFishObjId(locked_fish_objid);

            if (buffer_power)
            {
                List <object> param_list = new List <object>();
                mRenderBufferMgr.addBuffer("BufPower", param_list);
            }

            if (buffer_freeze)
            {
                List <object> param_list = new List <object>();
                mRenderBufferMgr.addBuffer("BufFreeze", param_list);
            }

            if (buffer_longpress)
            {
                List <object> param_list = new List <object>();
                mRenderBufferMgr.addBuffer("BufLongpress", param_list);
            }

            if (buffer_rapid)
            {
                List <object> param_list = new List <object>();
                mRenderBufferMgr.addBuffer("BufRapid", param_list);
            }

            mScene.getListener().onSceneTurretCreated(mTurretId);
        }