예제 #1
0
        private void EventSceneLoadCompleted(int mapId)
        {
            // 每个场景都会有默认的界面显示

            // 默认打开的界面
            // Loading 场景,这里mapid == 0,不处理
            if (mapId <= 0)
            {
                return;
            }

            ResourceWorld refMap = ResourceAll.GetInstance().MapMgr.GetReference(mapId);

            if (refMap == null || refMap.UiRes == (int)UiType.None)
            {
                return;
            }

            UiType uiType = Util.ChangeToEnum <UiType>(refMap.UiRes);

            if (uiType != UiType.None)
            {
                OpenUi(uiType);
            }
        }
예제 #2
0
        public World(ResourceWorld refobj)
        {
            _ref = refobj;

            _msgDispatcher.RegisterFollowPacket((int)Proto.MsgId.S2CRoleAppear, RoleAppear);
            _msgDispatcher.RegisterFollowPacket((int)Proto.MsgId.S2CMove, SyncMove);
        }
예제 #3
0
        private void MsgEnterWorld(Google.Protobuf.IMessage msg)
        {
            Proto.EnterWorld protoEnter = msg as Proto.EnterWorld;
            if (protoEnter == null)
            {
                return;
            }

            GameLogger.GetInstance().Debug($"Enter world. world id:{protoEnter.WorldId}");
            ResourceWorld refMap = ResourceAll.GetInstance().MapMgr.GetReference((int)protoEnter.WorldId);

            if (refMap == null)
            {
                return;
            }

            LoadScene(refMap.AbPath, refMap.ResName, (int)protoEnter.WorldId);
        }