Exemple #1
0
        //-------------------------------------------------------------------------
        public void setPosition(EbVector3 pos)
        {
            EbVector3 pixel_pos = CCoordinate.logic2toolkitPos(pos);
            Vector3   cur_pos;

            cur_pos.x           = pixel_pos.x;
            cur_pos.y           = pixel_pos.y;
            cur_pos.z           = mTransform.position.z;
            mTransform.position = cur_pos;
        }
Exemple #2
0
        //-------------------------------------------------------------------------
        public void setPosition(EbVector3 pos)
        {
            EbVector3 pixel_pos = CCoordinate.logic2toolkitPos(pos);

            pixel_pos += CLogicUtility.getVector2ByRotateAngle(mOffsetLocation, mDirection);

            Vector3 cur_pos;

            cur_pos.x           = pixel_pos.x;
            cur_pos.y           = pixel_pos.y;
            cur_pos.z           = mTransform.position.z;
            mTransform.position = cur_pos;
        }
Exemple #3
0
        //-------------------------------------------------------------------------
        Vector2 pixel2logicPos(Vector2 origin)
        {
            EbVector3 vv = CCoordinate.pixel2logicPos(new EbVector3(origin.x, origin.y, 0));

            return(new Vector2(vv.x, vv.y));
        }
Exemple #4
0
        public static Vector3 logic2pixel(this EbVector3 v)
        {
            EbVector3 pixel_pos = CCoordinate.logic2toolkitPos(v);

            return(pixel_pos.convert());
        }
Exemple #5
0
 //-------------------------------------------------------------------------
 public EbVector3 getAvatarPosition(int turret_id)
 {
     return(CCoordinate.logic2pixelPos(
                getTurretHelper().getPositionByOffset(turret_id, getRenderConfigure().TurretAvatarOffset)));
 }
Exemple #6
0
        //-------------------------------------------------------------------------
        public void update(float elapsed_tm)
        {
            if (mIsLoadingScene)
            {
                if (mLoadableManager.Loaded)
                {
                    getListener().onSceneCreated();
                    mIsLoadingScene = false;
                    mLoadableManager.destroy();
                    //UiMgr.Instance.destroyCurrentUi<UiMbLoading>();
                    return;
                }

                mLoadableManager.update(elapsed_tm);
                _loadingInfo(mLoadableManager.Progress, mLoadableManager.LoadingInfo);
                return;
            }

            mRenderObjectPool.update();// 要先于Level Update

            mProtocol.update(elapsed_tm);

            foreach (var it in mParticleTurnplateCallerQueue)
            {
                it.update(elapsed_tm);
            }

            mParticlemanager.update(elapsed_tm);

            // 根据屏幕分辨率更新坐标
            Resolution cur_resolution = Screen.currentResolution;

            CCoordinate.setCoordinate(new EbVector3(Screen.width, Screen.height, 0),
                                      EbVector3.Zero, new EbVector3(Screen.width, Screen.height, 0));

            // 更新炮台
            foreach (var i in mMapPlayerTurret)
            {
                i.Value.update(elapsed_tm);
            }

            // 更新关卡
            if (mLevel != null)
            {
                mLevel.update(elapsed_tm);
            }

            // 更新效果管理器
            mEffectMgr.update(elapsed_tm);

            // 更新所有鱼死亡分数显示
            CSpriteFishDieScore.updateall(elapsed_tm);

            // 本人正在观战
            if (mMyTurret == null && mLevel != null)
            {
                string str = "正在观战中...";
                //getListener().onSceneShowMessageBox(str, false, "", 1, (int)_eMessageBoxLayer.Ob, true, true);
            }

            displaySceneStateInfo(elapsed_tm);
        }
Exemple #7
0
        //-------------------------------------------------------------------------
        public void create(uint my_et_player_rpcid, bool single, bool is_bot, IRenderListener listener,
                           string configure_filepath, List <JsonPacket> json_packet_list, List <RouteJsonPacket> route_json_packet_list)
        {
            mMyPlayerId    = my_et_player_rpcid;
            mbSingle       = single;
            mListener      = listener;
            mbInit         = false;
            mIsBot         = is_bot;
            mConfigurePath = configure_filepath;

            InputController.Instance.onFingerTouch       += _onFingerTouch;
            InputController.Instance.onFingerLongPress   += _onFingerLongPress;
            InputController.Instance.onFingerUp          += _onFingerUp;
            InputController.Instance.onFingerDragMove    += _onFingerDragMove;
            InputController.Instance.onFingerTouchTurret += _onFingerTouchTurret;
            InputController.Instance.onFingerTouchBuffer += _onFingerTouchBuffer;
            InputController.Instance.onFingerTouchFish   += _onFingerTouchFish;

            InputController.Instance.ActiveInput = true;

            CCoordinate.setCoordinate(new EbVector3(Screen.width, Screen.height, 0),
                                      EbVector3.Zero, new EbVector3(Screen.width, Screen.height, 0));
            mSceneBox     = new CSceneBox();
            mProtocol     = new CRenderProtocol(this);
            mTurretHelper = new CTurretHelper();
            mLayerAlloter = new RenderLayerAlloter();

            mEffectMgr = new CEffectMgr();
            if (!isBot())
            {
                mEffectMgr.regEffectFactory(new EffectShockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFrameAnimationFactory());
                mEffectMgr.regEffectFactory(new EffectPlayAudioFactory());
                mEffectMgr.regEffectFactory(new EffectLightingFactory());
                mEffectMgr.regEffectFactory(new EffectLockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFullScreenFactory());
                mEffectMgr.regEffectFactory(new EffectAOEFactory());
            }
            else
            {
                //mEffectMgr.regEffectFactory(new EffectShockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFrameAnimationFactory());
                //mEffectMgr.regEffectFactory(new EffectPlayAudioFactory());
                mEffectMgr.regEffectFactory(new EffectLightingFactory());
                mEffectMgr.regEffectFactory(new EffectLockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFullScreenFactory());
                mEffectMgr.regEffectFactory(new EffectAOEFactory());
            }

            mSpriteFishFactory   = new SpriteFishFactory(this);
            mJsonPacketList      = json_packet_list;
            mRouteJsonPacketList = route_json_packet_list;

            mRenderConfigure = new RenderConfigure(mConfigurePath);

            mSoundMgr         = MbMain.Instance.getSoundMgr();
            mRenderObjectPool = new CRenderObjectPool(this);
            mParticlemanager  = new ParticleManager(this);
            mLoadableManager  = new LoadableManager();
            mLoadableManager.create(mRenderObjectPool);
        }
Exemple #8
0
 //-------------------------------------------------------------------------
 public EbVector3 getAvatarPosition()
 {
     return(CCoordinate.logic2pixelPos(
                mScene.getTurretHelper().getPositionByOffset(mTurretId, mScene.getRenderConfigure().TurretAvatarOffset)));
 }