Esempio n. 1
0
        //---------------------------------------------------------------------
        public void create(int turret_id, uint et_player_rpcid, string nickname,
                           bool is_bot, int default_turret_rate, TbDataTurret.TurretType turret_type)
        {
            mTurretId               = turret_id;
            mLockedFish             = null;
            mPlayer.et_player_rpcid = et_player_rpcid;
            mPlayer.nickname        = nickname;
            mPlayer.is_bot          = is_bot;
            mPlayer.rate            = 1.0f;
            mTurretType             = turret_type;
            mTurretDataTable        = new TurretDataTable();

            mBotRandom = new System.Random(unchecked ((int)System.DateTime.Now.Ticks) + turret_id * 1000);

            // 更新炮台倍率
            _setTurretRate(default_turret_rate);

            // 初始化炮台位置
            CTurretHelper turret_helper = new CTurretHelper();

            mTurretPos = turret_helper.getPositionByOffset(turret_id,
                                                           new EbVector3(0, 68, 0));
            mTurretAngle = turret_helper.getBaseAngleByTurretId(turret_id);

            if (isBot())
            {
                mLogicBot = new CLogicBot();
                mLogicBot.create(mScene, this, turret_type);
            }
        }
Esempio n. 2
0
        //---------------------------------------------------------------------
        public void destroy()
        {
            mLockedFish = null;

            foreach (var i in mMapBullet)
            {
                i.Value.Dispose();
            }
            mMapBullet.Clear();

            if (mLogicBot != null)
            {
                mLogicBot.destroy();
                mLogicBot = null;
            }
        }
Esempio n. 3
0
        //---------------------------------------------------------------------
        public void destroy()
        {
            mLockedFish = null;

            foreach (var i in mMapBullet)
            {
                i.Value.Dispose();
            }
            mMapBullet.Clear();

            if (mLogicBot != null)
            {
                mLogicBot.destroy();
                mLogicBot = null;
            }
        }
Esempio n. 4
0
        //---------------------------------------------------------------------
        public void create(int turret_id, uint et_player_rpcid, string nickname,
            bool is_bot, int default_turret_rate, TbDataTurret.TurretType turret_type)
        {
            mTurretId = turret_id;
            mLockedFish = null;
            mPlayer.et_player_rpcid = et_player_rpcid;
            mPlayer.nickname = nickname;
            mPlayer.is_bot = is_bot;
            mPlayer.rate = 1.0f;
            mTurretType = turret_type;
            mTurretDataTable = new TurretDataTable();

            mBotRandom = new System.Random(unchecked((int)System.DateTime.Now.Ticks) + turret_id * 1000);

            // 更新炮台倍率
            _setTurretRate(default_turret_rate);

            // 初始化炮台位置
            CTurretHelper turret_helper = new CTurretHelper();
            mTurretPos = turret_helper.getPositionByOffset(turret_id,
                new EbVector3(0, 68, 0));
            mTurretAngle = turret_helper.getBaseAngleByTurretId(turret_id);

            if (isBot())
            {
                mLogicBot = new CLogicBot();
                mLogicBot.create(mScene, this, turret_type);
            }
        }