//------------------------------------------------------------------------- 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(CRenderScene scene, CRenderTurret render_turret) { mScene = scene; mRenderTurret = render_turret; mRenderTurret.getTurretId(); _initTurretBase(); _initTurretTop(); _initTurretBarrel(); _initTurretBlaze(); _setTrigger(true); mTkMaterial = GameObject.Instantiate(Resources.Load(mTkMaterialName)) as UnityEngine.Material; mGlowMaterial = GameObject.Instantiate(Resources.Load(mGlowMaterialName)) as UnityEngine.Material; #if UNITY_EDITOR mTurretBaseSprite.gameObject.name = "TkSpriteTurret"; mTurretTopSprite.gameObject.name = "TkSpriteTurret"; mTurretBlazeSprite.gameObject.name = "TkSpriteTurret"; mTurretBarrelSprite.gameObject.name = "TkSpriteTurret"; #endif if (mRenderTurret.isMyTurret()) { startGlow(5f); } }
void ss() { CRenderTurret turret = mScene.getTurret(mPlayerId); if (turret == null) { return; } TbDataFish fish_data = EbDataMgr.Instance.getData <TbDataFish>(mFishVibId); turret.displayScoreTurnplate(mTotalScore, fish_data.TurnplateParticle); }
//------------------------------------------------------------------------- public void create(CRenderScene scene, CRenderTurret render_turret) { mScene = scene; mRenderTurret = render_turret; mCSpriteTurretFort = new CSpriteTurretFort(); mCSpriteTurretFort.create(mScene, mRenderTurret); mLinkLockedFishFeature = new LinkLockedFishFeature(mScene, mRenderTurret); //mRateNumber = new CSpriteNumber(mScene, new CPanelDigitFactory(mScene)); //mRateNumber.create(0, mRateNumberPosition, mRateNumberAngel, CSpriteNumber._eNumberSize.Small1); //mRateNumber.setTag("CSpriteTurret" + mRenderTurret.getTurretId()); //mRateNumber.setTrigger(true); }
//------------------------------------------------------------------------- void _particleFixedTarget(StillParticle still_particle, TbDataFish.ParticleDataStruct particle_data, uint et_player_rpcid) { CRenderTurret turret = mScene.getTurret(et_player_rpcid); EbVector3 start_position = EbVector3.Zero; if (particle_data.StartPoint.ParticlePointType == TbDataFish.ParticlePointStruct.ParticlePointTypeEnum.Fish) { start_position = mCRenderFish.Position; } else if (particle_data.StartPoint.ParticlePointType == TbDataFish.ParticlePointStruct.ParticlePointTypeEnum.Fixed) { start_position = new EbVector3(particle_data.StartPoint.x, particle_data.StartPoint.y, 0); } still_particle.setRoute(RouteHelper.buildLineRoute( start_position, new EbVector3(particle_data.TargetPoint.x, particle_data.TargetPoint.y, 0)), 200); }
//------------------------------------------------------------------------- public void create(CRenderScene scene, CRenderTurret render_turret) { mScene = scene; if (mScene.isBot()) { return; } mCSpriteTurretScoreShow = new CSpriteTurretScoreShow(); mCSpriteTurretScoreShow.create(scene, render_turret); mSpriteTurret = new CSpriteTurret(); mSpriteTurret.create(scene, render_turret); mSpriteTurret.aimAt(render_turret.getTurretAngle()); mSpriteTurret.displayRate(render_turret.getTurretRate()); mSpriteTurret.reloadAnimation(); }
//------------------------------------------------------------------------- void _hitFish(CRenderFish render_fish) { if (render_fish == null || render_fish.IsDie) { return; } uint et_player_rpcid = mBullet.getPlayerId(); if (mBullet.getScene().getMyPlayerId() == et_player_rpcid) { mBullet.getScene().getProtocol().c2sFishHit(et_player_rpcid, mBullet.getBulletObjId(), render_fish.FishObjId); } mBullet.signDestroy(); mIsSignDestroy = true; CRenderTurret turret = mBullet.getScene().getTurret(et_player_rpcid); if (turret == null) { return; } TbDataTurret vib_turret = turret.getVibTurret(); Dictionary <string, object> map_param = new Dictionary <string, object>(); map_param.Add("SourcePosition", getHitPosition(render_fish.Position, mBullet.getPosition())); map_param["NetColor"] = mBullet.getScene().getTurret(et_player_rpcid).getTurretColor(); map_param["PlayerId"] = et_player_rpcid; map_param["BulletHitFish"] = render_fish; TbDataBullet buttlt_data = mBullet.getBulletData(); mBullet.getScene().addEffect(buttlt_data.EffectCompose.Id, map_param, EffectTypeEnum.Client); if (!string.IsNullOrEmpty(mHitParticle.ParticlePrefabName)) { StillParticle particle = mScene.getParticlemanager().newParticle(mHitParticle.ParticlePrefabName); particle.setPosition(getHitPosition(render_fish.Position, mBullet.getPosition())); particle.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.FishHitParticle)); } }
//------------------------------------------------------------------------- public void fishCoins(uint et_player_rpcid) { if (null == mFishData.mCoinParticle.CointParticleData) { return; } if (mFishData.mCoinParticle.CointParticleData.Id <= 0) { return; } CRenderTurret turret = mScene.getTurret(et_player_rpcid); if (turret == null) { return; } string coin_particle_name = mFishData.mCoinParticle.CointParticleData.ParticlePrefabName; int radius = mFishData.mCoinParticle.Radius; int coin_count = mFishData.mCoinParticle.CointCount; if (radius <= 0) { radius = 30; } if (coin_count <= 0) { coin_count = 1; } float layer = mScene.getLayerAlloter().getLayer(_eLevelLayer.Coin); StillParticle still_particle = mParticlemanager.newParticle(coin_particle_name); still_particle.setLayer(layer); still_particle.create(mCRenderFish.Position.logic2pixel(), turret.getTurretPos().logic2pixel(), coin_count, layer); }