diff --git a/Assets/Scripts/ConfigureNavBar.cs b/Assets/Scripts/ConfigureNavBar.cs index 7d8b906..3d3ae01 100644 --- a/Assets/Scripts/ConfigureNavBar.cs +++ b/Assets/Scripts/ConfigureNavBar.cs @@ -6,11 +6,17 @@ using TMPro; public class ConfigureNavBar : MonoBehaviour { - public GameObject canvas1; - public GameObject canvas2; + [SerializeField] + private GameObject canvas1; - public GameObject addressField1; - public GameObject addressField2; + [SerializeField] + private GameObject canvas2; + + [SerializeField] + private GameObject addressField1; + + [SerializeField] + private GameObject addressField2; private BoxCollider boxCollider1; private BoxCollider boxCollider2; diff --git a/Assets/Scripts/ConfigureObservers.cs b/Assets/Scripts/ConfigureObservers.cs index 34b5ef6..6951527 100644 --- a/Assets/Scripts/ConfigureObservers.cs +++ b/Assets/Scripts/ConfigureObservers.cs @@ -8,7 +8,7 @@ public class ConfigureObservers : MonoBehaviour { private IMixedRealitySpatialAwarenessSystem spatialAwarenessSystem; - void Start() + private void Start() { spatialAwarenessSystem = MixedRealityToolkit.Instance.GetService(); diff --git a/Assets/Scripts/ConfigureOrbital.cs b/Assets/Scripts/ConfigureOrbital.cs index 6aeeeae..cfff29b 100644 --- a/Assets/Scripts/ConfigureOrbital.cs +++ b/Assets/Scripts/ConfigureOrbital.cs @@ -7,8 +7,11 @@ using Microsoft.MixedReality.Toolkit.Utilities.Solvers; public class ConfigureOrbital : MonoBehaviour { - public GameObject canvas1; - public GameObject canvas2; + [SerializeField] + private GameObject canvas1; + + [SerializeField] + private GameObject canvas2; // public List canvases; diff --git a/Assets/Scripts/EndpointLoader.cs b/Assets/Scripts/EndpointLoader.cs index 91330ac..5f354db 100644 --- a/Assets/Scripts/EndpointLoader.cs +++ b/Assets/Scripts/EndpointLoader.cs @@ -8,10 +8,17 @@ using Microsoft.MixedReality.WebView; public class EndpointLoader : MonoBehaviour { - public WebView webView1; - public WebView webView2; - public ServiceDiscovery serviceDiscovery; - public ServicesListPopulator servicesListPopulator; + [SerializeField] + private WebView webView1; + + [SerializeField] + private WebView webView2; + + [SerializeField] + private ServiceDiscovery serviceDiscovery; + + [SerializeField] + private ServicesListPopulator servicesListPopulator; private bool triedMulticast = false; private string apiUrl = "http://windows.loca:5000/api/endpoints"; // Typo on purpose @@ -124,16 +131,11 @@ public class EndpointLoader : MonoBehaviour { servicesListPopulator.AddItemFromService(service, () => { - ChangeApiUrl($"http://{service.Host}:{service.Port}{service.Path}"); + apiUrl = $"http://{service.Host}:{service.Port}{service.Path}"; + StartCoroutine(LoadEndpoints()); }); } - public void ChangeApiUrl(string newUrl) - { - apiUrl = newUrl; - StartCoroutine(LoadEndpoints()); - } - public void ReloadEndpoints() { triedMulticast = false; diff --git a/Assets/Scripts/MdnsService.cs b/Assets/Scripts/MdnsService.cs index 7fe2951..769405e 100644 --- a/Assets/Scripts/MdnsService.cs +++ b/Assets/Scripts/MdnsService.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; public class MdnsService { - public string IpAddress { get; set; } - public int Port { get; set; } - public string Path { get; set; } - public string Host { get; set; } + public string IpAddress { get; } + public int Port { get; } + public string Path { get; } + public string Host { get; } public MdnsService(string ipAddress, int port, string path, string host) { diff --git a/Assets/Scripts/ScrollablePagination.cs b/Assets/Scripts/ScrollablePagination.cs index fd73244..7f0c21e 100644 --- a/Assets/Scripts/ScrollablePagination.cs +++ b/Assets/Scripts/ScrollablePagination.cs @@ -6,25 +6,14 @@ public class ScrollablePagination : MonoBehaviour [SerializeField] private ScrollingObjectCollection scrollView; - public ScrollingObjectCollection ScrollView - { - get - { - if (scrollView == null) - { - scrollView = GetComponent(); - } - return scrollView; - } - set - { - scrollView = value; - } - } - public void ScrollByTier(int amount) { - Debug.Assert(ScrollView != null, "Scroll view needs to be defined before using pagination."); + if (scrollView == null) + { + Debug.LogError("ScrollingObjectCollection is not set."); + return; + } + scrollView.MoveByTiers(amount); } } \ No newline at end of file diff --git a/Assets/Scripts/WebViewBrowser.cs b/Assets/Scripts/WebViewBrowser.cs index ab0dcc4..f89ee69 100644 --- a/Assets/Scripts/WebViewBrowser.cs +++ b/Assets/Scripts/WebViewBrowser.cs @@ -6,7 +6,8 @@ using System; public class WebViewBrowser : MonoBehaviour { - public TMP_InputField URLField; + [SerializeField] + private TMP_InputField URLField; private void Start() {