//------------------------------------------------------------------------- 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, TbDataFish vib_fish_data) { mScene = scene; mVibFishData = vib_fish_data; mFishCycleGap = mScene.getLayerAlloter().EachFishGap / 10f; if (mVibFishData.Type == TbDataFish.FishType.Custom) { mCycle = mScene.getRenderObjectPool().newFishStillSprite(); mCycle.init(this, scene); mCycle.playAnimation(mVibFishData.FishCompose.BackGroundAniName); mCycle.setScale((float)mVibFishData.FishCompose.BackGroundAnimationScale / 100.0f); foreach (var it in mVibFishData.FishCompose.FishComposes) { if (null != it && it.Id > 0) { TbDataFish fish_data = EbDataMgr.Instance.getData<TbDataFish>(it.FishVibId); FishStillSprite fish_sprite = mScene.getRenderObjectPool().newFishStillSprite(); fish_sprite.init(this, scene); fish_sprite.playAnimation(fish_data.FishAnimMove); fish_sprite.setScale(mFixFishScale * (float)fish_data.FishHeight / (float)fish_data.FishPixelHeight); mFishs.Add(new FishSpriteAndOffset( fish_sprite, new EbVector3(it.OffsetX, it.OffsetY, 0), fish_data.FishAnimDie)); } } } }
public void add(EbVector3 origin, EbVector3 gap, CRenderScene scene, CSpriteCounter._tScoreCountScruct score_count, float up_angle) { int index_null = mCSpriteHeaps.Length; for (int i = mCSpriteHeaps.Length - 1; i >= 0; --i) { if (mCSpriteHeaps[i] == null) { index_null = i; } else { break; } } if (index_null >= mCSpriteHeaps.Length) { return; } EbVector3 position = origin; position -= gap * index_null; mCSpriteHeaps[index_null] = new CSpriteHeap(scene, score_count.Number, score_count.Score, position, up_angle, getColor()); }
public LinkLockedFishFeature(CRenderScene scene, CRenderTurret turret) { mCRenderTurret = turret; mScene = scene; mLayer = mScene.getLayerAlloter().getLayer(_eLevelLayer.LinkLockedFish); mArrow = mScene.getRenderObjectPool().newStillSprite(); mArrow.setScale(0.5f); mArrow.playAnimation("locking_line_array"); mArrow.setColor(mCRenderTurret.getTurretColor()); mArrow.setLayer(mLayer); mNumber = mScene.getRenderObjectPool().newStillSprite(); mNumber.setScale(1f); mNumber.playAnimation("locking_line_target_" + mCRenderTurret.getTurretId()); mNumber.setColor(mCRenderTurret.getTurretColor()); mNumber.setLayer(mLayer); setActive(false); #if UNITY_EDITOR mArrow.gameObject.name = "TkSpriteLinkLocked_locking_line_array"; mNumber.gameObject.name = "TkSpriteLinkLocked_locking_line_target_" + mCRenderTurret.getTurretId(); #endif }
//------------------------------------------------------------------------- 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); } }
//------------------------------------------------------------------------- public CRenderBufferMgr(CRenderScene scene, CRenderTurret turret, EbVector3 position, float up_angle) { mScene = scene; mTurret = turret; mFisrtPoint = position; mUpAngle = up_angle; }
//------------------------------------------------------------------------- public ParticleManager(CRenderScene scene) { mScene = scene; #if UNITY_EDITOR mTKGameObject = GameObject.Find("TKParticle"); #endif }
//------------------------------------------------------------------------- public CRenderProtocol(CRenderScene scene) { mScene = scene; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcLogicUpdate] = _s2allcLogicUpdate; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcPlayerEnter] = _s2allcPlayerEnter; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcPlayerLeave] = _s2allcPlayerLeave; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcPlayerDropped] = _s2allcPlayerDropped; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcPlayerReConnect] = _s2allcPlayerReConnect; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcLevelUpdate] = _s2allcLevelUpdate; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcCreateFishLord] = _s2allcCreateFishLord; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcFishDie] = _s2allcFishDie; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcCreateClientEffect] = _s2allcCreateClientEffect; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcAoeFishDie] = _s2allcAoeFishDie; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcTurretRate] = _s2allcTurretRate; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcManualFire] = _s2allcManualFire; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcAutoFire] = _s2allcAutoFire; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcEfxFire] = _s2allcEfxFire; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcLockFish] = _s2allcLockFish; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcUnlockFish] = _s2allcUnlockFish; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcBeginLongpress] = _s2allcBeginLongpress; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcEndLongpress] = _s2allcEndLongpress; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcBeginRapid] = _s2allcBeginRapid; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcEndRapid] = _s2allcEndRapid; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcBeginPower] = _s2allcBeginPower; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcEndPower] = _s2allcEndPower; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcSetTurret] = _s2allcSetTurret; mMapServerAoIMethod[(byte)_eProtocolDesktop.s2allcSyncAllPlayerGold] = _s2allcSyncAllPlayerGold; mMapServerMethod[(byte)_eProtocolDesktop.s2cSnapshotScene] = _s2cSnapshotScene; }
//------------------------------------------------------------------------- public CSpriteScoreTurnplate(CRenderScene scene, EbVector3 position, float up_angle) { mScene = scene; mPosition = position; mAngle = up_angle; mSpriteNumber = new CSpriteNumber(mScene, new CScoreDigitFactory(mScene)); mSpriteNumber.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.TurretScore)); }
//--------------------------------------------------------------------- public CRenderLevelStateSwitch(CRenderScene render_scene, CRenderLevel render_level) { _defState("CRenderLevelStateSwitch", "EbFsm", 0, false); _bindAction("update", new EbAction(this.evUpdate)); _bindAction("setState", new EbAction(this.evSetState)); mScene = render_scene; mLevel = render_level; }
//------------------------------------------------------------------------- public ParticleTurnplateCaller(CRenderScene scene, uint et_player_rpcid, int fish_vib_id, int total_score, List<StillParticle> particle_list) { mScene = scene; mPlayerId = et_player_rpcid; mFishVibId = fish_vib_id; mTotalScore = total_score; mParticleList = particle_list; }
//------------------------------------------------------------------------- public CRenderBuffer(CRenderScene scene, CRenderTurret turret, string name, List<object> param, string animation_name) { mScene = scene; mTurret = turret; mName = name; mParam = param; mAnimationName = animation_name; _initCSprite(mName, "CSpriteBuffer" + mTurret.getTurretId().ToString()); }
//------------------------------------------------------------------------- public CRenderBufferRapid(CRenderScene scene, CRenderTurret turret, string name, List<object> param, string prefab_name) : base(scene, turret, name, param, prefab_name) { if (_isMe()) { mScene.getProtocol().c2sBeginRapid(mScene.getMyPlayerId()); } //mScene.getListener().onSceneShowInfo("开始极速发炮"); }
//------------------------------------------------------------------------- public void init(CRenderScene scene) { mScene = scene; mSprite = gameObject.GetComponent<tk2dSprite>(); mSpriteAnimator = gameObject.GetComponent<tk2dSpriteAnimator>(); mTransform = transform; if (mSpriteAnimator == null) return; setKinematic(); }
//------------------------------------------------------------------------- public override void create(CRenderScene scene, TbDataFish vib_fish_data) { base.create(scene, vib_fish_data); if (mVibFishData.Type == TbDataFish.FishType.EvenFive) { //_initSprite(154f, 80f); _initSprite(108.89f, 108.89f, 80f); } _setBackgroundSize(0.7f); }
//------------------------------------------------------------------------- public void create(CRenderScene render_scene) { mScene = render_scene; _initRippleBackground(); mBackgroundLoader = new CSpriteBackgroundLoader(); mLevelScreenShocker = new LevelScreenShocker(mScene, mBackgroundLoader); mLevelBackgroundMgr = new LevelBackgroundMgr(mScene, mBackgroundLoader); mLevelSeaStarMgr = new LevelSeaStarMgr(mScene); }
//------------------------------------------------------------------------- CSpriteFishDieScore(CRenderScene render_scene, EbVector3 pos, int score, float delay_time) { mCSpriteNumber = new CSpriteNumber(render_scene, new CScoreDigitFactory(render_scene)); mCSpriteNumber.create(score, pos, 0, getByScore(score)); mCSpriteNumber.setLayer(render_scene.getLayerAlloter().getLayer(_eLevelLayer.FishScore)); mFunDelayTime = delay_time; mIsNeedAutoDestroy = true; _initRoute(pos, 0); mNumber = score; }
public void create(CRenderScene scene, ISpriteFish sprite_fish, TbDataFish vib_fish_data) { mScene = scene; mFixedScale = (float)vib_fish_data.CycleHeight / (float)vib_fish_data.CyclePixelHeight; initFish("red_fish_bottom_bottom", EbVector3.Zero, 130, mScene.getLayerAlloter().EachFishGap / 10f * 3, sprite_fish); //initFish("red_fish_bottom_middle", EbVector3.Zero, -130, mScene.getLayerAlloter().EachFishGap / 10f * 2, sprite_fish); initFish("red_fish_bottom_sign2", EbVector3.Zero, 0, mScene.getLayerAlloter().EachFishGap / 10f, sprite_fish); setScale(mFixedScale); }
//--------------------------------------------------------------------- public CRenderLevelStateNormal(CRenderScene render_scene, CRenderLevel render_level) { _defState("CRenderLevelStateNormal", "EbFsm", 0, true); _bindAction("update", new EbAction(this.evUpdate)); _bindAction("setState", new EbAction(this.evSetState)); mScene = render_scene; mLevel = render_level; // 因为初始化的时候首先是这个状态先出来,所以在这里加载一下地图 mLevel.getSpriteLevel().switchBackgroundMap(mLevel.CurMapVibId, 0); }
//------------------------------------------------------------------------- public void create(Color color, uint et_player_rpcid, CRenderFish hit_by_bullet_fish, CRenderScene scene, string animation_name) { mScene = scene; mPlayerId = et_player_rpcid; mCSpriteFishNetGroup = new CSpriteFishNetGroup(); mCSpriteFishNetGroup.create(mScene, color, mPlayerId, animation_name); mCSpriteFishNetGroup.setTrigger(true); mCSpriteFishNetGroup.setColor(color); mCSpriteFishNetGroup.onTriggerEnter += OnTriggerEnter; addFishList(hit_by_bullet_fish); }
//------------------------------------------------------------------------- public CSpriteHeap(CRenderScene scene, int number_of_chip, int score, EbVector3 position, float up_angle, CSpriteBgNumber.BgColorEnum color) { mScene = scene; mHeapScruct.NumberOfChip = number_of_chip; mHeapScruct.Position = position; mHeapScruct.UpAngle = up_angle; mHeapScruct.Alpha = 1f; mCSpriteBgNumber = new CSpriteBgNumber(mScene, color, score); mHeapLayer = mScene.getLayerAlloter().getLayer(_eLevelLayer.TurretChips); mHeapState = _eHeapState.Adding; }
//------------------------------------------------------------------------- public override void create(Dictionary <string, object> param) { mMapParam = param; mScene = mMapParam["RenderScene"] as CRenderScene; if (mMapParam.ContainsKey("SourcePosition")) { mSourcePosition = (EbVector3)mMapParam["SourcePosition"]; } if (mMapParam.ContainsKey("DestPosition")) { mDestPosition = (EbVector3)mMapParam["DestPosition"]; } }
//------------------------------------------------------------------------- public CSpriteCounter(CRenderScene scene, EbVector3 origin_position, float up_angle) { mScene = scene; mCounterScruct.MovingSpeed = 100f; mCounterScruct.OriginPosition = origin_position; mCounterScruct.UpAngle = up_angle; mCounterScruct.GapBetweenHeaps = mScene.getRenderConfigure().ChipHSpace; mCounterScruct.RightAngle = CLogicUtility.getRightAngle(up_angle); mCounterScruct.RightDistance = CLogicUtility.getDirection(mCounterScruct.RightAngle) * mCounterScruct.GapBetweenHeaps; mCounterState = _eCounterState.Adding; mCSpriteHeapGroup = new CSpriteHeapGroup(4); mScoreCounterMap.create(mScene.getRenderConfigure().ScoreGap); }
//------------------------------------------------------------------------- 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(); }
//------------------------------------------------------------------------- public override void create(Dictionary<string, object> param) { mMapParam = param; mScene = mMapParam["RenderScene"] as CRenderScene; if (mMapParam.ContainsKey("SourcePosition")) { mSourcePosition = (EbVector3)mMapParam["SourcePosition"]; } if (mMapParam.ContainsKey("DestPosition")) { mDestPosition = (EbVector3)mMapParam["DestPosition"]; } }
//------------------------------------------------------------------------- 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); }
//------------------------------------------------------------------------- public LevelBackgroundMgr(CRenderScene scene, CSpriteBackgroundLoader loader) { mScene = scene; mBackgroundLoader = loader; mSpeed = 960f / mMaxTime; mWaveStillSprite = mScene.getRenderObjectPool().newStillSprite(); mWaveStillSprite.playAnimation("WaterWave"); mWaveStillSprite.setActive(false); mWaveStillSprite.setScale(700f / 550f); #if UNITY_EDITOR mWaveStillSprite.gameObject.name = "TkSpriteWaterWave"; #endif }
public void create(CRenderScene scene) { mScene = scene; mStillSprites.Add(newSpriteBox(false, false, 2, 2)); mStillSprites.Add(newSpriteBox(true, false, 2, 2)); mStillSprites.Add(newSpriteBox(false, false, 2, 2)); mStillSprites.Add(newSpriteBox(false, true, 2, 2)); mStillSprites.Add(newSpriteBox(true, true, 2, 2)); mStillSprites.Add(newSpriteBox(false, true, 2, 2)); mStillSprites.Add(newSpriteBox(false, false, 2, 2)); mStillSprites.Add(newSpriteBox(true, false, 2, 2)); mStillSprites.Add(newSpriteBox(false, false, 2, 2)); }
//------------------------------------------------------------------------- public void create(CRenderScene scene, CRenderBullet render_bullet, string animation_name, TbDataParticle hit_particle) { mScene = scene; mBullet = render_bullet; mHitParticle = hit_particle; mStillSprite = mScene.getRenderObjectPool().newStillSprite(); mStillSprite.setTrigger(true); mStillSprite.playAnimation(animation_name); mStillSprite.onTriggerEnter += OnTriggerEnter; #if UNITY_EDITOR mStillSprite.gameObject.name = "TkSpriteBullet_" + animation_name; #endif mBoxY = mStillSprite.getBoxColliderSize().y; }
//------------------------------------------------------------------------- public CSpriteScore(CRenderScene scene, EbVector3 position, float angle, int turret_no) { mScene = scene; mSpriteNumber = new CSpriteNumber(mScene, new CPanelDigitFactory(mScene)); mSpriteNumber.create(0, position, angle, CSpriteNumber._eNumberSize.Small1, CSpriteNumber._eNumberAlign.Right); mSpriteNumber.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.TurretScore)); mBackground = mScene.getRenderObjectPool().newStillSprite(); mBackground.playAnimation("score_panel_" + turret_no); mBackground.setScale(1, 1f); setScore(0); #if UNITY_EDITOR mBackground.gameObject.name = "TkSpriteSpriteScore_score_panel_" + turret_no; #endif }
//------------------------------------------------------------------------- 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(); }
//------------------------------------------------------------------------- public override void release() { foreach (var i in MapEtActorMirrorByGuid) { i.Value.close(); } MapEtActorMirrorByGuid.Clear(); AllSeat = null; if (Scene != null) { Scene.Dispose(); Scene = null; } EbLog.Note("ClientPlayerDesktop.release()"); }
//------------------------------------------------------------------------- public CSpriteBgNumber(CRenderScene scene, BgColorEnum color, int number) { mScene = scene; float number_layer = mScene.getLayerAlloter().getLayer(_eLevelLayer.TurretScore); mCSpriteNumber = new CSpriteNumber(mScene, new CPanelDigitFactory(mScene)); mCSpriteNumber.create(number, EbVector3.Zero, 0, CSpriteNumber._eNumberSize.Small2); mCSpriteNumber.setLayer(number_layer); mNumberBackgroundCSprite = mScene.getRenderObjectPool().newStillSprite(); mNumberBackgroundCSprite.setLayer(number_layer + mScene.getLayerAlloter().EachFishGap / 100f); mNumberBackgroundCSprite.setScale(0.65f * number.ToString().Length, 0.8f); mNumberBackgroundCSprite.playAnimation(getAnimationNameByColor(color)); #if UNITY_EDITOR mNumberBackgroundCSprite.gameObject.name = "TkSpriteChips_" + getAnimationNameByColor(color); #endif }
//------------------------------------------------------------------------- public FishParticleMgr(CRenderScene render_scene, CRenderFish fish, int fish_vib_id, ISpriteFish sprite_fish) { mScene = render_scene; mCRenderFish = fish; mParticlemanager = mScene.getParticlemanager(); mISpriteFish = sprite_fish; mFishData = EbDataMgr.Instance.getData<TbDataFish>(fish_vib_id); //解析鱼带的特效数据并保存下来,等待鱼指定播放特效 foreach (var it in mFishData.ParticleArray) { if (null == it.TbDataParticle || it.TbDataParticle.Id <= 0) continue; TbDataFish.ParticleProduceTimeEnum time_enum = (TbDataFish.ParticleProduceTimeEnum)it.ParticleProduceTime; if (!mDicParticleData.ContainsKey(time_enum)) { mDicParticleData[time_enum] = new List<TbDataFish.ParticleDataStruct>(); } mDicParticleData[time_enum].Add(it); } }
//--------------------------------------------------------------------- public void create(CRenderScene scene, TbDataFish vib_fish_data) { mScene = scene; mVibFishData = vib_fish_data; mFishCycleGap = mScene.getLayerAlloter().EachFishGap / 10f; bool has_cycle = !string.IsNullOrEmpty(mVibFishData.CycleAnimationName); for (int i = 0; i < mFishNumber; i++) { mFishs.Add(mScene.getRenderObjectPool().newFishStillSprite()); if (has_cycle) { mRedBottom = new CSpriteRedBottom(); mRedBottom.create(mScene, this, mVibFishData); } } foreach (var it in mFishs) { it.init(this, scene); } float fish_scale = ((float)mVibFishData.FishHeight / (float)mVibFishData.FishPixelHeight); foreach (var it in mFishs) { it.setScale(0.7f * fish_scale); } playAnimation(mVibFishData.FishAnimMove); if (mVibFishData.Red == TbDataFish.IsRed.YES) { mInitColor = new Color(1, 0, 0); resetColor(1); } }
//------------------------------------------------------------------------- public CRenderTurret(CRenderScene render_scene) { mScene = render_scene; }
//------------------------------------------------------------------------- public CRenderBufferFreeze(CRenderScene scene, CRenderTurret turret, string name, List <object> param, string prefab_name) : base(scene, turret, name, param, prefab_name) { //mScene.getListener().onSceneShowInfo("创建冻结buffer"); }
//------------------------------------------------------------------------- public CRenderBullet(CRenderScene render_scene) { mScene = render_scene; }
//------------------------------------------------------------------------- public CRenderObjectPool(CRenderScene scene) { mFishSpritePool.create(scene); mStillSpritePool.create(scene); }
//------------------------------------------------------------------------- public CSpriteNumber(CRenderScene render_scene, CSpriteNumberFactory factory) { mScene = render_scene; mFactory = factory; }
//------------------------------------------------------------------------- public CRenderBufferLock(CRenderScene scene, CRenderTurret turret, string name, List <object> param, string animation_name) : base(scene, turret, name, param, animation_name) { mScene = scene; resetLockedFishObjId((int)param[0]); }
public CSpriteNumberFactory(CRenderScene scene) { mScene = scene; }
//------------------------------------------------------------------------- public CRenderBufferPower(CRenderScene scene, CRenderTurret turret, string name, List <object> param, string prefab_name) : base(scene, turret, name, param, prefab_name) { mTurret.setBarrelColor(new Color(1, 0, 0)); }
//------------------------------------------------------------------------- public LevelSeaStarMgr(CRenderScene render_scene) { mScene = render_scene; }
//------------------------------------------------------------------------- public CRenderFishFactory(CRenderScene scene) { mScene = scene; }
//------------------------------------------------------------------------- public StillSprite newBackgroundStillSprite(string prefab_name, CRenderScene scene) { return(mStillSpriteLoader.loadSpriteFromPrefab("Game/Background/" + prefab_name + "Prefab", scene)); }
//------------------------------------------------------------------------- public BgSpriteMgr(CRenderScene scene, CSpriteBackgroundLoader loader) { mScene = scene; mBackgroundLoader = loader; }
//------------------------------------------------------------------------- public LevelScreenShocker(CRenderScene render_scene, CSpriteBackgroundLoader loader) { mScene = render_scene; mBackgroundLoader = loader; }
//------------------------------------------------------------------------- public virtual void create(CRenderScene scene, TbDataFish vib_fish_data) { mScene = scene; mVibFishData = vib_fish_data; mFishCycleGap = mScene.getLayerAlloter().EachFishGap / 10f; }
//------------------------------------------------------------------------- // 桌子通知 void s2cPlayerDesktopNotify(DesktopNotify desktop_notify) { switch (desktop_notify.id) { case DesktopNotifyId.DesktopInit: // 桌子初始化 { EbLog.Note("ClientPlayerDesktop.s2cPlayerDesktopNotify() DesktopInit"); CoPlayer.CoPlayerLobby.hideLobby(); clearDesktop(); var desktop_data = EbTool.protobufDeserialize <DesktopData>(desktop_notify.data); DesktopConfigData = desktop_data.desktop_cfg_data; //UiMbPlayDesktop ui_desk = UiMgr.Instance.createUi<UiMbPlayDesktop>(_eUiLayer.Background); //ui_desk.setDeskInfo(this, 60f); byte index = 0; AllSeat = new SeatInfo[DesktopConfigData.seat_num]; foreach (var i in AllSeat) { SeatInfo seat_info = new SeatInfo(); seat_info.index = index; seat_info.et_playermirror = null; AllSeat[index] = seat_info; index++; } EntityData me_data = desktop_data.list_actormirror.Find((EntityData entity_data) => { return(entity_data.entity_guid.Equals(CoPlayer.Entity.Guid)); }); _initActorMirror(me_data); foreach (var i in desktop_data.list_actormirror) { if (i.entity_guid.Equals(CoPlayer.Entity.Guid)) { continue; } _initActorMirror(i); } var co_me = MeMirror.getComponent <ClientActorMirror <DefActorMirror> >(); byte me_id = co_me.Def.PropActorIdInDesktop.get(); RenderListener listener = new RenderListener(this); Scene = new CRenderScene(); //var loading = UiMgr.Instance.createUi<UiMbLoading>(_eUiLayer.Loading); //Scene.onSceneLoading = loading.setLoadProgress;//null;//ui_mgr.getLoading().setRateOfProgress; //Scene.create(mMyPlayerId, mbSingle, false, listener, "RenderSceneConfigure.json", // new JsonPacketReader("Media/Fishing/FishLord/").readJsonPacketList(), // new JsonPacketReader("Media/Fishing/Route/").readRouteJsonPacketList()); } break; case DesktopNotifyId.PlayerSceneAction: // 玩家场景操作 { var vec_param = EbTool.protobufDeserialize <List <string> >(desktop_notify.data); if (Scene != null) { Scene.sceneOnRecvFromLogic(vec_param); } } break; case DesktopNotifyId.PlayerSceneAoIUpdate: // 玩家场景广播 { var ev_aoi = EbTool.protobufDeserialize <_tAoIEvent>(desktop_notify.data); if (Scene != null && Init) { Scene.sceneOnRecvAoIFromLogic(ev_aoi.vec_param); } } break; case DesktopNotifyId.PlayerChat: // 玩家聊天广播 { if (string.IsNullOrEmpty(DesktopConfigData.desktop_etguid)) { return; } var msg_recv = EbTool.protobufDeserialize <ChatMsgRecv>(desktop_notify.data); Entity et_playermirror = null; MapEtActorMirrorByGuid.TryGetValue(msg_recv.et_player_guid_send, out et_playermirror); if (et_playermirror != null) { var co_playermirror = et_playermirror.getComponent <ClientActorMirror <DefActorMirror> >(); co_playermirror.desktopChat(msg_recv); } } break; case DesktopNotifyId.PlayerEnter: // 玩家进入桌子 { if (string.IsNullOrEmpty(DesktopConfigData.desktop_etguid)) { return; } EntityData et_playermirror_data = EbTool.protobufDeserialize <EntityData>(desktop_notify.data); if (MapEtActorMirrorByGuid.ContainsKey(et_playermirror_data.entity_guid)) { return; } var et_playermirror = EntityMgr.genEntity <EtPlayerMirror, Entity>(et_playermirror_data, Entity); var co_actormirror = et_playermirror.getComponent <ClientActorMirror <DefActorMirror> >(); MapEtActorMirrorByGuid[et_playermirror.Guid] = et_playermirror; //byte seat_index = co_actormirror.Def.mPropSeatIndex.get(); //if (isValidSeatIndex(seat_index)) //{ // AllSeat[seat_index].et_playermirror = et_playermirror; //} EbLog.Note("ClientPlayerDesktop.s2cPlayerDesktopNotify() PlayerEnter PlayerEtGuid=" + et_playermirror.Guid); } break; case DesktopNotifyId.PlayerLeave: // 玩家离开桌子 { if (string.IsNullOrEmpty(DesktopConfigData.desktop_etguid)) { return; } string player_et_guid = EbTool.protobufDeserialize <string>(desktop_notify.data); EbLog.Note("ClientPlayerDesktop.s2cPlayerDesktopNotify() PlayerLeave PlayerEtGuid=" + player_et_guid); Entity et_playermirror = null; if (MapEtActorMirrorByGuid.TryGetValue(player_et_guid, out et_playermirror)) { var co_actormirror = et_playermirror.getComponent <ClientActorMirror <DefActorMirror> >(); MapEtActorMirrorByGuid.Remove(player_et_guid); foreach (var i in AllSeat) { if (i.et_playermirror != null && i.et_playermirror.Guid == player_et_guid) { i.et_playermirror = null; break; } } et_playermirror.close(); } } break; case DesktopNotifyId.PlayerOb: // 玩家Ob { if (string.IsNullOrEmpty(DesktopConfigData.desktop_etguid)) { return; } string player_etguid = EbTool.protobufDeserialize <string>(desktop_notify.data); EbLog.Note("ClientPlayerDesktop.s2cPlayerDesktopNotify() PlayerOb PlayerEtGuid=" + player_etguid); Entity et_playermirror = null; if (MapEtActorMirrorByGuid.TryGetValue(player_etguid, out et_playermirror)) { var co_actormirror = et_playermirror.getComponent <ClientActorMirror <DefActorMirror> >(); co_actormirror.playerOb(); } } break; case DesktopNotifyId.PlayerSitdown: // 玩家坐下 { if (string.IsNullOrEmpty(DesktopConfigData.desktop_etguid)) { return; } var sitdown_data = EbTool.protobufDeserialize <PlayerSitdownData>(desktop_notify.data); EbLog.Note("ClientPlayerDesktop.s2cPlayerDesktopNotify() PlayerSitdown PlayerEtGuid=" + sitdown_data.player_etguid); Entity et_playermirror = null; if (MapEtActorMirrorByGuid.TryGetValue(sitdown_data.player_etguid, out et_playermirror)) { var co_actormirror = et_playermirror.getComponent <ClientActorMirror <DefActorMirror> >(); co_actormirror.playerSitdown(sitdown_data.seat_index, sitdown_data.stack, sitdown_data.state); } } break; case DesktopNotifyId.PlayerWaitWhile: // 玩家暂离 { if (string.IsNullOrEmpty(DesktopConfigData.desktop_etguid)) { return; } var waitwhile_data = EbTool.protobufDeserialize <PlayerWaitWhileData>(desktop_notify.data); EbLog.Note("ClientPlayerDesktop.s2cPlayerDesktopNotify() PlayerWaitWhile PlayerEtGuid=" + waitwhile_data.player_etguid); Entity et_playermirror = null; if (MapEtActorMirrorByGuid.TryGetValue(waitwhile_data.player_etguid, out et_playermirror)) { var co_actormirror = et_playermirror.getComponent <ClientActorMirror <DefActorMirror> >(); co_actormirror.playerWaitWhile(waitwhile_data.wait_while_tm); } } break; case DesktopNotifyId.PlayerReturn: // 玩家返回 { if (string.IsNullOrEmpty(DesktopConfigData.desktop_etguid)) { return; } var return_data = EbTool.protobufDeserialize <PlayerReturnData>(desktop_notify.data); EbLog.Note("ClientPlayerDesktop.s2cPlayerDesktopNotify() PlayerReturn PlayerEtGuid=" + return_data.player_etguid); Entity et_playermirror = null; if (MapEtActorMirrorByGuid.TryGetValue(return_data.player_etguid, out et_playermirror)) { var co_actormirror = et_playermirror.getComponent <ClientActorMirror <DefActorMirror> >(); co_actormirror.playerReturn(return_data.stack, return_data.state); } } break; default: break; } }
//------------------------------------------------------------------------- public CScoreDigitFactory(CRenderScene scene) : base(scene) { }
//------------------------------------------------------------------------- public CPanelDigitFactory(CRenderScene scene) : base(scene) { }
//------------------------------------------------------------------------- public SpriteFishFactory(CRenderScene scene) { mScene = scene; }
//------------------------------------------------------------------------- public CRenderLevel(CRenderScene render_scene, string configure_filepath) { mScene = render_scene; }