private void ClickChangeLayerState(ModelLayer layer) { if (!instanceLoaded) { Debug.Log("No model loaded, cannot show layer."); return; } bool addLayer = !layersLoaded.ContainsKey(layer); if (!addLayer) { UnloadLayer(layer); } else { if (layer.DataType == DataType.Volumetric) { List <ModelLayer> layersToUnload = new List <ModelLayer>(); foreach (KeyValuePair <ModelLayer, LayerLoaded> entry in layersLoaded) { layersToUnload.Add(entry.Key); } foreach (ModelLayer l in layersToUnload) { UnloadLayer(l); HoloUtilities.SetButtonStateText(layersButtons[l], false); } } LoadLayer(layer); } HoloUtilities.SetButtonStateText(layersButtons[layer], addLayer); }
private void ClickSetColorMap(string colorMapName, GameObject currentButton) { MapName = colorMapName; foreach (GameObject button in colorMapButtons.Keys) { HoloUtilities.SetButtonStateText(button.GetComponent <PressableButtonHoloLens2>(), currentButton == button); } PlayerPrefs.SetString("ColorMap", colorMapName); PlayerPrefs.Save(); }
private void LoadInitialLayers() { if (!instanceLoaded) { throw new Exception("Cannot call TodoLoadMeshLayer before LoadInstance"); } Assert.IsTrue(instanceBundle != null); ModelLayer layer = instanceBundle.Layers.First <ModelLayer>(l => !l.Simulation); LoadLayer(layer); HoloUtilities.SetButtonStateText(layersButtons[layer], true); }