Пример #1
0
        private IEnumerator Start()
        {
            //instantiate stored components
            downloader  = GetComponent <DownloadManager>();
            tileFactory = GetComponent <TileFactory>();
            if (tileTextureCache == null)
            {
                tileTextureCache =
                    GetComponent <TileTextureCache>(); //GameObject.Find("TileTextureCache").GetComponent<TileTextureCache>();
            }

            //start processes
            //Load the local text files used to initialize the LayerLoader
            //this is done before the information is needed because you cannot access TextAsset from a thread
            LayerLoader.Init();

            //Kick off the main xml parsing in a thread to keep the application from hanging, especially for vr
            new Thread(() =>
            {
                //get the available layers by parsing the xml
                availableLayers = LayerLoader.GetLayers();
                //let the main thread know that it is safe to try to access the layers
                parsedAvailableLayers = true;
            }).Start();
            WaitForEndOfFrame w = new WaitForEndOfFrame();

            //wait for the xml to finish parsing
            while (!parsedAvailableLayers)
            {
                yield return(w);
            }

            LoadLayer(initialLayer, initialDateTime);
            CreateRootTiles();
            StartCoroutine(UpdateTileVisibility());
        }
Пример #2
0
 private static void GetLayersList()
 {
     layersList      = new List <string>(LayerLoader.GetLayers().Keys);
     isGettingLayers = false;
 }