Beispiel #1
0
        public void UpdateParcelScenesExecute(LoadParcelScenesMessage.UnityParcelScene scene)
        {
            if (scene == null || scene.id == null)
            {
                return;
            }

            var sceneToLoad = scene;

            ProfilingEvents.OnMessageProcessStart?.Invoke(MessagingTypes.SCENE_UPDATE);

            ParcelScene parcelScene = Environment.i.world.state.GetScene(sceneToLoad.id) as ParcelScene;

            if (parcelScene != null)
            {
                parcelScene.SetUpdateData(sceneToLoad);
            }

            ProfilingEvents.OnMessageProcessEnds?.Invoke(MessagingTypes.SCENE_UPDATE);
        }
Beispiel #2
0
        public void UpdateParcelScenesExecute(string sceneId)
        {
            LoadParcelScenesMessage.UnityParcelScene sceneData;

            ProfilingEvents.OnMessageDecodeStart?.Invoke(MessagingTypes.SCENE_UPDATE);
            sceneData = Utils.SafeFromJson <LoadParcelScenesMessage.UnityParcelScene>(sceneId);
            ProfilingEvents.OnMessageDecodeEnds?.Invoke(MessagingTypes.SCENE_UPDATE);

            IWorldState worldState = Environment.i.world.state;

            if (worldState.TryGetScene(sceneData.id, out IParcelScene sceneInterface))
            {
                ParcelScene scene = sceneInterface as ParcelScene;
                scene.SetUpdateData(sceneData);
            }
            else
            {
                LoadParcelScenesExecute(sceneId);
            }
        }