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 }
//------------------------------------------------------------------------- // 手势触摸到炮台对应的物件 void _onFingerTouchTurret(int turret_id) { if (mMyTurret != null && mMyTurret.getTurretId() == turret_id) { //mMyTurret.requestSwitchTurretRate(); } }
//------------------------------------------------------------------------- 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 void create(uint et_player_rpcid, int bullet_objid, int bullet_vibid, float bullet_speed, int locked_fish_obj_id, EbVector3 turret_pos, float turret_angle, TbDataParticle hit_particle) { // vib mPlayerId = et_player_rpcid; mVibBullet = EbDataMgr.Instance.getData <TbDataBullet>(bullet_vibid); mPos = turret_pos; mfAngle = turret_angle; mBulletObjId = bullet_objid; mLockedFishObjid = locked_fish_obj_id; //mfBulletSpeed = mVibBullet.Speed; mfBulletSpeed = bullet_speed; // sprite bullet CRenderTurret turret = mScene.getTurret(mPlayerId); int turret_id = turret.getTurretId(); string bullet_anim = mVibBullet.Bullet0Animation; if (turret.isPower()) { bullet_anim = mVibBullet.ColorBulletAnimation; } else { switch (turret_id) { case 1: bullet_anim = mVibBullet.Bullet1Animation; break; case 2: bullet_anim = mVibBullet.Bullet2Animation; break; case 3: bullet_anim = mVibBullet.Bullet3Animation; break; case 4: bullet_anim = mVibBullet.Bullet4Animation; break; case 5: bullet_anim = mVibBullet.Bullet5Animation; break; case 6: bullet_anim = mVibBullet.Bullet6Animation; break; } } mBulletAnim = bullet_anim; mSpriteBullet = new CSpriteBullet(); mSpriteBullet.create(mScene, this, mBulletAnim, hit_particle); mSpriteBullet.setTrigger(true, 200); mSpriteBullet.setPosition(mPos); mSpriteBullet.setDirection(mfAngle); mSpriteBullet.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.Bullet)); mSpriteBullet.setScale((float)mVibBullet.BulletHeight / (float)mVibBullet.BulletPixelHeight); mScene.getLevel().addBullet(this); }