//------------------------------------------------------------------------- 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); }
//--------------------------------------------------------------------- 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); } }
//------------------------------------------------------------------------- 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); }
//--------------------------------------------------------------------- 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); } }