void updateWorld() { while (db == null) { ; } string dds = world + "_map_big_revealed.dds"; AssetDatabase adb = AssetDatabaseInst.DB; byte[] data = adb.extractUsingFilename(dds, AssetDatabase.RequestCategory.TEXTURE); image.texture = DDSLoader.DatabaseLoaderTexture_DDS.LoadDDS(data); int sizeX = 0; int sizeY = 0; CDRParse.getMinMax(world, ref sizeX, ref sizeY); int tileX = sizeX / 256; int tileY = sizeY / 256; RectTransform rt = image.GetComponent <RectTransform>(); rt.sizeDelta = new Vector2(tileX * pixelsPerMeter, tileY * pixelsPerMeter); List <WorldSpawn> spawns = CDRParse.getSpawns(adb, db, world); foreach (WorldSpawn spawn in spawns) { if (spawn.imagePath != null && spawn.imagePath.Length > 0) { GameObject go = GameObject.Instantiate <GameObject>(teleportTemplate, teleportRoot.transform); MapTeleport mt = go.AddComponent <MapTeleport>(); mt.spawn = spawn; RawImage ri = go.GetComponent <RawImage>(); RectTransform rrt = go.GetComponent <RectTransform>(); rrt.anchoredPosition = new Vector3((spawn.pos.x / 256.0f) * pixelsPerMeter, ((spawn.pos.z / 256.0f) * pixelsPerMeter), 0); go.SetActive(true); makeTrigger(go, EventTriggerType.PointerEnter, (x) => OnPointerEnter((PointerEventData)x)); makeTrigger(go, EventTriggerType.PointerExit, (x) => OnPointerExit((PointerEventData)x)); //makeTrigger(go, EventTriggerType.PointerDown, (x) => OnPointerClick((PointerEventData)x)); makeTrigger(go, EventTriggerType.PointerClick, (x) => OnPointerClick((PointerEventData)x)); } } }
// Update is called once per frame void Update() { if (doMapChange) { SceneManager.LoadScene("scene1"); return; } if (db != null && !first) { Debug.Log("TestDecomp update called"); first = true; Debug.Log("get keys"); worlds.Clear(); worlds.AddRange(CDRParse.getSpawns(adb, db, null)); worlds.Add(new WorldSpawn("warfront_13", "unknown", Vector3.zero, 0)); favs.Add("tm_Meridian_EpochPlaza"); worlds = worlds.OrderBy(w => !favs.Contains(w.spawnName)).ThenBy(w => w.worldName).ThenBy(w => w.spawnName).ToList(); updateWorldDropdown(); dropdownbox.SetActive(true); loadbutton.SetActive(true); loadModelViewerbutton.SetActive(true); loadWardrobebutton.SetActive(true); thirdPersonToggle.SetActive(true); tex.enabled = false; } else { } if (tex != null && img != null) { tex.text = error; img.color = color; } }