diff --git a/Assets/MixedRealityToolkit.Generated/CustomProfiles/MixedRealitySpeechCommandsProfile.asset b/Assets/MixedRealityToolkit.Generated/CustomProfiles/MixedRealitySpeechCommandsProfile.asset index 9890300..2ffd1cb 100644 --- a/Assets/MixedRealityToolkit.Generated/CustomProfiles/MixedRealitySpeechCommandsProfile.asset +++ b/Assets/MixedRealityToolkit.Generated/CustomProfiles/MixedRealitySpeechCommandsProfile.asset @@ -38,7 +38,7 @@ MonoBehaviour: description: None axisConstraint: 0 - localizationKey: - keyword: Hello + keyword: Service keyCode: 0 action: id: 0 diff --git a/Assets/Scripts/ServicesListPopulator.cs b/Assets/Scripts/ServicesListPopulator.cs index ac105e9..1b9d52b 100644 --- a/Assets/Scripts/ServicesListPopulator.cs +++ b/Assets/Scripts/ServicesListPopulator.cs @@ -16,6 +16,8 @@ public class ServicesListPopulator : MonoBehaviour [SerializeField] private GridObjectCollection gridObjectCollection; + private bool isVisible = true; + public void AddItemFromService(MdnsService service, Action action) { GameObject itemInstance = Instantiate(dynamicItem, gridObjectCollection.transform); @@ -29,8 +31,20 @@ public class ServicesListPopulator : MonoBehaviour { Debug.Log($"Clicked on service: {service.Host}"); action.Invoke(); + ToggleVisibility(); }); gridObjectCollection.UpdateCollection(); + scrollView.UpdateContent(); + } + + public void ToggleVisibility() + { + isVisible = !isVisible; + + foreach (Renderer renderer in GetComponentsInChildren()) + { + renderer.enabled = isVisible; + } } } \ No newline at end of file