private void MenuButtonDelegate(object sender, ClickedEventArgs e) { choosing = true; listView.SetActive(true); infoTextMesh.text = "Existing Scans"; downloading = false; updatedData = false; viewing = false; pointCloudHolder.transform.localPosition = Vector3.zero; foreach (Transform child in pointCloudHolder.transform) { if (child.gameObject.name.StartsWith("Cloud")) { GameObject.Destroy(child.gameObject); } } WebList webList = listView.GetComponent <WebList>(); if (useFolder) { webList.SetupFolder(listLocation); } else { webList.Setup(listLocation); } }
// Use this for initialization void Start() { pointer = controllerRightObject.GetComponent <SteamVR_LaserPointer>(); pointer.PointerIn += PointerInDelegate; pointer.PointerOut += PointerOutDelegate; controller = pointer.GetComponent <SteamVR_TrackedController>(); controller.TriggerClicked += TriggerDelegate; controller.MenuButtonClicked += MenuButtonDelegate; infoTextMesh = textView.GetComponent <TextMesh>(); string configJson = System.IO.File.ReadAllText("config.cfg"); JSONObject json = new JSONObject(configJson); json.GetField(out useFolder, "useFolder", false); print("got useFolder: " + useFolder); if (useFolder) { string path; json.GetField(out path, "folder", null); print("got folder: " + path); WebList webList = listView.GetComponent <WebList>(); listLocation = path; webList.SetupFolder(path); } else { string dlLocation; json.GetField(out listLocation, "listLocation", ""); json.GetField(out dlLocation, "dlLocation", ""); print("got listLocation: " + listLocation); print("got dlLocation: " + dlLocation); WebList webList = listView.GetComponent <WebList>(); webList.Setup(listLocation); WEB_DL_LOCATION = dlLocation; } }