Beispiel #1
0
        public StreamingManager(ISceneResourceRequestHandler requestHandler,
                                IStreamingGoManager streamingGo,
                                StreamingData sceneDescription,
                                ScenesLightmapData.MeshRecords scenesLightmapRecords,
                                ScenesIndoorCullData.IndoorCullRecords scenesIndoorCullRecords,
                                WorldCompositionParam param,
                                int preloadSceneCount)
        {
            _requestHandler          = requestHandler;
            _sceneDescription        = sceneDescription;
            _scenesLightmapRecords   = scenesLightmapRecords;
            _scenesIndoorCullRecords = scenesIndoorCullRecords;
            _concurrentCount         = preloadSceneCount;

            _worldComposition = new WorldCompositionManager(this, param);
            _streamingGo      = streamingGo ?? new StreamingGoByScene();

            _streamingGo.SetResourceHandler(this);
            _triggerObjectManager = SingletonManager.Get <TriggerObjectManager>();
            if (_sceneDescription != null)
            {
                var count = _sceneDescription.Scenes.Count;
                for (int i = 0; i < count; i++)
                {
                    _sceneIndex.Add(_sceneDescription.Scenes[i].SceneName, i);
                }
            }

            _requestHandler.SceneLoaded   += SceneLoaded;
            _requestHandler.SceneUnloaded += SceneUnloaded;
            _requestHandler.GoLoaded      += GoLoaded;
            _requestHandler.GoUnloaded    += GoUnloaded;
        }
Beispiel #2
0
        public StreamingManager(ISceneResourceRequestHandler requestHandler,
                                IStreamingGoManager streamingGo,
                                StreamingData sceneDescription,
                                WorldCompositionParam param,
                                int preloadSceneCount)
        {
            _requestHandler   = requestHandler;
            _sceneDescription = sceneDescription;
            _concurrentCount  = preloadSceneCount;

            _worldComposition = new WorldCompositionManager(this, param);
            _streamingGo      = streamingGo ?? new StreamingGoByScene();

            _streamingGo.SetResourceHandler(this);

            if (_sceneDescription != null)
            {
                var count = _sceneDescription.Scenes.Count;
                for (int i = 0; i < count; i++)
                {
                    _sceneIndex.Add(_sceneDescription.Scenes[i].SceneName, i);
                }
            }

            _requestHandler.SceneLoaded   += SceneLoaded;
            _requestHandler.SceneUnloaded += SceneUnloaded;
            _requestHandler.GoLoaded      += GoLoaded;
            _requestHandler.GoUnloaded    += GoUnloaded;
        }