//------------------------------------------------------------------------- public void setRoute(IRoute route, float speed) { if (mMassEntity == null) { mMassEntity = new MassEntity(); } mMassEntity.setRoute(route); mMassEntity.setSpeed(speed); update(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; }
//------------------------------------------------------------------------- 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; } }