Beispiel #1
0
        public void OnLoadResources(IUnityAssetManager assetManager)
        {
            _terrainRenderer.GetTerrainDataNames(_terrainName);
            if (_terrainName.Count > 0)
            {
                for (int i = 0; i < _terrainName.Count; ++i)
                {
                    AssetInfo addr = new AssetInfo("tablesfrombuilding", _terrainName[i]);

                    _logger.InfoFormat("´òËãÔØÈë _terrainName£¬BundleName={0}, AssetName={1}", addr.BundleName, addr.AssetName);

                    assetManager.LoadAssetAsync((UnityEngine.Object)null, addr, _terrainRenderer.LoadedTerrainData);
                }

                _terrainName.Clear();
            }

            if (_sessionState != null)
            {
                if (_levelManager.NotFinishedRequests <= 0 &&
                    _terrainRenderer.IsLoadingEnd)
                {
                    _sessionState.FullfillExitCondition(typeof(TerrainDataLoadSystem));
                }
                else
                {
                    if ((System.DateTime.Now - _lastPrintTime).TotalMilliseconds > _logInterval)
                    {
                        _lastPrintTime = System.DateTime.Now;

                        _logger.InfoFormat("NotFinishedRequests =={0}, IsLoadingEnd =={1}", _levelManager.NotFinishedRequests, _terrainRenderer.IsLoadingEnd);
                        _logger.InfoFormat(_levelManager.GetRequestString());

                        //if (_logInterval < 60000)
                        //    _logInterval *= 2;
                    }
                }
            }
        }