コード例 #1
0
        //---------------------------------------------------------------------
        void _initDieRoute()
        {
            mMassEntity = new MassEntity();
            RouteParaCurve route = new RouteParaCurve();

            route.create(mRenderFish.Position, 0, 0.6f, mRenderFish.jumpDistance());
            mMassEntity.setRoute(route);
        }
コード例 #2
0
        //-------------------------------------------------------------------------
        void _initRoute(EbVector3 init_position, float init_direction)
        {
            mMassEntity = new MassEntity();
            RouteParaCurve route = new RouteParaCurve();

            route.create(init_position, init_direction, 0.4f, 20f);
            mMassEntity.setRoute(route);
        }
コード例 #3
0
 //-------------------------------------------------------------------------
 public void setRoute(IRoute route, float speed)
 {
     if (mMassEntity == null)
     {
         mMassEntity = new MassEntity();
     }
     mMassEntity.setRoute(route);
     mMassEntity.setSpeed(speed);
     update(0);
 }
コード例 #4
0
 //-------------------------------------------------------------------------
 void initMove(int move_step)
 {
     if (move_step <= 0)
     {
         return;
     }
     mMassEntity = new MassEntity();
     mMassEntity.setSpeed(mCounterScruct.MovingSpeed);
     mMassEntity.setRoute(RouteHelper.buildLineRoute(EbVector3.Zero, mCounterScruct.RightDistance * move_step));
     mCounterState = _eCounterState.Moving;
 }
コード例 #5
0
        //-------------------------------------------------------------------------
        void _playFireAnimation()
        {
            mMassEntity = new MassEntity();
            RouteParaCurve route = new RouteParaCurve();

            route.create(mRenderTurret.getTurretPos(), mRenderTurret.getTurretAngle(), 0.1f, -13f);
            mMassEntity.setRoute(route);
            mIsFireAnimation = true;
            mTurretBlazeSprite.setActive(true);
            mTurretBlazeSprite.setPosition(mRenderTurret.getTurretPos());
            mTurretBlazeSprite.setDirection(mRenderTurret.getTurretAngle());
        }
コード例 #6
0
        //-------------------------------------------------------------------------
        public void create(int fish_vibid, int fish_objid)
        {
            mFishData  = EbDataMgr.Instance.getData <TbDataFish>(fish_vibid);
            mFishObjId = fish_objid;
            mSpeed     = mFishData.getSpeed();

            mFishType = (TbDataFish.FishType)mFishData.Type;

            mMassEntity = new MassEntity();
            mMassEntity.setSpeed(mSpeed);

            mFishCollider = mScene.getColliderMgr().newFishCollider(0, 0, 80, 80, this);//读取vib配置

            update(0);
        }
コード例 #7
0
        //-------------------------------------------------------------------------
        public void create(int fish_vib_id, int fish_objid)
        {
            mVibFish   = EbDataMgr.Instance.getData <TbDataFish>(fish_vib_id);
            mFishObjId = fish_objid;

            mISpriteFish = mScene.getSpriteFishFactory().buildSpriteFish(this, fish_vib_id);

            mMassEntity = new MassEntity();
            mMassEntity.setSpeed(mVibFish.getSpeed());

            mISpriteFish.setDirection(0);

            mFishParticleMgr = new FishParticleMgr(mScene, this, fish_vib_id, mISpriteFish);
            mFishParticleMgr.fishBorn();
            mFishParticleMgr.fishMoving();
        }
コード例 #8
0
        //-------------------------------------------------------------------------
        void moveHeaps(float elapsed_tm)
        {
            if (mMassEntity == null)
            {
                return;
            }

            mOldPositon = mMassEntity.Position;
            mMassEntity.update(elapsed_tm);

            mCSpriteHeapGroup.translate(mMassEntity.Position - mOldPositon);

            if (mMassEntity.IsEndRoute)
            {
                mCSpriteHeapGroup.swapHeaps();
                mCounterState = _eCounterState.Adding;
                mMassEntity   = null;
            }
        }
コード例 #9
0
        //-------------------------------------------------------------------------
        public void switchBackground(string prefab_name, float already_update_time)
        {
            if (mBgMgr == null)
            {
                _loadBgSprite(prefab_name);
                if (onLoadMapEnd != null)
                {
                    onLoadMapEnd();
                }
            }
            else
            {
                if (mIsSwitching)
                {
                    if (!mHasEarlyClean)
                    {
                        mScene.getLevel().clearAllFish();
                    }
                    switchBackgroundPic();
                    mWaveStillSprite.setActive(false);
                    mIsSwitching = false;
                }
                mAlreadyUpdateTime = already_update_time;
                mBgMgr.mBgClippedSprite.ClipRect = new Rect(1, 0, 1, 1);
                _loadFgSprite(prefab_name);

                mMassEntity = new MassEntity();
                mMassEntity.setSpeed(mSpeed);
                mMassEntity.setRoute(RouteHelper.buildLineRoute(new EbVector3(650, 0, 0), CLogicUtility.getDirection(-90), 2000));
                mWaveStillSprite.setActive(true);
                mWaveStillSprite.setDirection(-90);
                mWaveStillSprite.setPosition(new EbVector3(650, 0, 0));
                mWaveStillSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.Ripple));

                mIsSwitching   = true;
                mHasEarlyClean = false;
            }
        }
コード例 #10
0
ファイル: LevelBackgroundMgr.cs プロジェクト: yinlei/Fishing
        //-------------------------------------------------------------------------
        public void switchBackground(string prefab_name, float already_update_time)
        {
            if (mBgMgr == null)
            {
                _loadBgSprite(prefab_name);
                if (onLoadMapEnd != null) onLoadMapEnd();
            }
            else
            {
                if (mIsSwitching)
                {
                    if (!mHasEarlyClean)
                    {
                        mScene.getLevel().clearAllFish();
                    }
                    switchBackgroundPic();
                    mWaveStillSprite.setActive(false);
                    mIsSwitching = false;
                }
                mAlreadyUpdateTime = already_update_time;
                mBgMgr.mBgClippedSprite.ClipRect = new Rect(1, 0, 1, 1);
                _loadFgSprite(prefab_name);

                mMassEntity = new MassEntity();
                mMassEntity.setSpeed(mSpeed);
                mMassEntity.setRoute(RouteHelper.buildLineRoute(new EbVector3(650, 0, 0), CLogicUtility.getDirection(-90), 2000));
                mWaveStillSprite.setActive(true);
                mWaveStillSprite.setDirection(-90);
                mWaveStillSprite.setPosition(new EbVector3(650, 0, 0));
                mWaveStillSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.Ripple));

                mIsSwitching = true;
                mHasEarlyClean = false;
            }
        }
コード例 #11
0
ファイル: StillParticle.cs プロジェクト: yinlei/Fishing
 //-------------------------------------------------------------------------
 public void setRoute(IRoute route, float speed)
 {
     if (mMassEntity == null)
     {
         mMassEntity = new MassEntity();
     }
     mMassEntity.setRoute(route);
     mMassEntity.setSpeed(speed);
     update(0);
 }
コード例 #12
0
ファイル: LogicFish.cs プロジェクト: yinlei/Fishing
        //-------------------------------------------------------------------------
        public void create(int fish_vibid, int fish_objid)
        {
            mFishData = EbDataMgr.Instance.getData<TbDataFish>(fish_vibid);
            mFishObjId = fish_objid;
            mSpeed = mFishData.getSpeed();

            mFishType = (TbDataFish.FishType)mFishData.Type;

            mMassEntity = new MassEntity();
            mMassEntity.setSpeed(mSpeed);

            mFishCollider = mScene.getColliderMgr().newFishCollider(0, 0, 80, 80, this);//读取vib配置

            update(0);
        }
コード例 #13
0
ファイル: CSpriteCounter.cs プロジェクト: yinlei/Fishing
        //-------------------------------------------------------------------------
        void moveHeaps(float elapsed_tm)
        {
            if (mMassEntity == null) return;

            mOldPositon = mMassEntity.Position;
            mMassEntity.update(elapsed_tm);

            mCSpriteHeapGroup.translate(mMassEntity.Position - mOldPositon);

            if (mMassEntity.IsEndRoute)
            {
                mCSpriteHeapGroup.swapHeaps();
                mCounterState = _eCounterState.Adding;
                mMassEntity = null;
            }
        }
コード例 #14
0
ファイル: CSpriteCounter.cs プロジェクト: yinlei/Fishing
 //-------------------------------------------------------------------------
 void initMove(int move_step)
 {
     if (move_step <= 0) return;
     mMassEntity = new MassEntity();
     mMassEntity.setSpeed(mCounterScruct.MovingSpeed);
     mMassEntity.setRoute(RouteHelper.buildLineRoute(EbVector3.Zero, mCounterScruct.RightDistance * move_step));
     mCounterState = _eCounterState.Moving;
 }
コード例 #15
0
ファイル: RenderFish.cs プロジェクト: yinlei/Fishing
        //-------------------------------------------------------------------------
        public void create(int fish_vib_id, int fish_objid)
        {
            mVibFish = EbDataMgr.Instance.getData<TbDataFish>(fish_vib_id);
            mFishObjId = fish_objid;

            mISpriteFish = mScene.getSpriteFishFactory().buildSpriteFish(this, fish_vib_id);

            mMassEntity = new MassEntity();
            mMassEntity.setSpeed(mVibFish.getSpeed());

            mISpriteFish.setDirection(0);

            mFishParticleMgr = new FishParticleMgr(mScene, this, fish_vib_id, mISpriteFish);
            mFishParticleMgr.fishBorn();
            mFishParticleMgr.fishMoving();
        }
コード例 #16
0
ファイル: CSpriteFishDieScore.cs プロジェクト: yinlei/Fishing
 //-------------------------------------------------------------------------
 void _initRoute(EbVector3 init_position, float init_direction)
 {
     mMassEntity = new MassEntity();
     RouteParaCurve route = new RouteParaCurve();
     route.create(init_position, init_direction, 0.4f, 20f);
     mMassEntity.setRoute(route);
 }
コード例 #17
0
ファイル: CSpriteFishGroup.cs プロジェクト: yinlei/Fishing
 //---------------------------------------------------------------------
 void _initDieRoute()
 {
     mMassEntity = new MassEntity();
     RouteParaCurve route = new RouteParaCurve();
     route.create(mRenderFish.Position, 0, 0.6f, mRenderFish.jumpDistance());
     mMassEntity.setRoute(route);
 }
コード例 #18
0
ファイル: CSpriteTurretFort.cs プロジェクト: yinlei/Fishing
 //-------------------------------------------------------------------------
 void _playFireAnimation()
 {
     mMassEntity = new MassEntity();
     RouteParaCurve route = new RouteParaCurve();
     route.create(mRenderTurret.getTurretPos(), mRenderTurret.getTurretAngle(), 0.1f, -13f);
     mMassEntity.setRoute(route);
     mIsFireAnimation = true;
     mTurretBlazeSprite.setActive(true);
     mTurretBlazeSprite.setPosition(mRenderTurret.getTurretPos());
     mTurretBlazeSprite.setDirection(mRenderTurret.getTurretAngle());
 }