//------------------------------------------------------------------------- void _loadSeaStar(int map_id) { TbDataMap data = EbDataMgr.Instance.getData <TbDataMap>(map_id); foreach (var it in data.SeaStarParticle) { try { if (it.TbDataParticle == null || it.TbDataParticle.Id == 0) { continue; } StillParticle still_particle = mScene.getParticlemanager().newParticle(it.TbDataParticle.ParticlePrefabName); still_particle.setPosition(new EbVector3(it.PositionX, it.PositionY, 0)); still_particle.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.StarFish)); mSeaStar.Add(still_particle); #if UNITY_EDITOR still_particle.gameObject.name = "TkSpriteSeaStar_" + it.TbDataParticle.ParticlePrefabName; #endif } catch (Exception e) { Debug.LogWarning(e); } } }
//------------------------------------------------------------------------- void _newParticle(EbVector3 position, int fish_vib_id) { if (mParticleMax < 0) { return; } --mParticleMax; mStillParticle = mScene.getParticlemanager().newParticle(mEffectAOEData.ParticleName.ParticlePrefabName); mStillParticle.setPosition(position); mStillParticle.setLayer(mScene.getLayerAlloter().getFishLayer(fish_vib_id)); }
//------------------------------------------------------------------------- public void display(int score, TbDataParticle particle_data) { if (score <= 0) return; mSpriteNumber.create(score, 100, mPosition, mAngle + mCurrentAngle); mStillParticle = mScene.getParticlemanager().newParticle(particle_data.ParticlePrefabName); mStillParticle.setPosition(mPosition); mStillParticle.setLooping(false); mStillParticle.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.TurretScoreBg)); mIsDisplay = true; initRotate(); }
//------------------------------------------------------------------------- public void display(int score, TbDataParticle particle_data) { if (score <= 0) { return; } mSpriteNumber.create(score, 100, mPosition, mAngle + mCurrentAngle); mStillParticle = mScene.getParticlemanager().newParticle(particle_data.ParticlePrefabName); mStillParticle.setPosition(mPosition); mStillParticle.setLooping(false); mStillParticle.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.TurretScoreBg)); mIsDisplay = true; initRotate(); }
//------------------------------------------------------------------------- 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)); } }
//------------------------------------------------------------------------- StillParticle _buildParticle(TbDataFish.ParticleDataStruct particle_data, uint et_player_rpcid) { StillParticle still_particle = mParticlemanager.newParticle(particle_data.TbDataParticle.ParticlePrefabName); if (particle_data.TargetPoint.ParticlePointType == TbDataFish.ParticlePointStruct.ParticlePointTypeEnum.None || particle_data.TargetPoint.ParticlePointType == TbDataFish.ParticlePointStruct.ParticlePointTypeEnum.Default) { _particleNoneTarget(still_particle, particle_data, et_player_rpcid); } else if (particle_data.TargetPoint.ParticlePointType == TbDataFish.ParticlePointStruct.ParticlePointTypeEnum.Turret) { _particleTurretTarget(still_particle, particle_data, et_player_rpcid); } else if (particle_data.TargetPoint.ParticlePointType == TbDataFish.ParticlePointStruct.ParticlePointTypeEnum.Fixed) { _particleTurretTarget(still_particle, particle_data, et_player_rpcid); } still_particle.setLayer(mScene.getLayerAlloter().getFishLayer(mFishData.Id)); return(still_particle); }
//------------------------------------------------------------------------- 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); }
//------------------------------------------------------------------------- void _newParticle(EbVector3 position, int fish_vib_id) { if (mParticleMax < 0) return; --mParticleMax; mStillParticle = mScene.getParticlemanager().newParticle(mEffectAOEData.ParticleName.ParticlePrefabName); mStillParticle.setPosition(position); mStillParticle.setLayer(mScene.getLayerAlloter().getFishLayer(fish_vib_id)); }