From 7082141a70676439cacab73fbe9165ab7cdb40d3 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Mon, 11 Nov 2024 22:33:10 +0100 Subject: [PATCH] Remove unused dependencies and reuse code --- Assets/Scripts/ConfigureNavBar.cs | 2 -- Assets/Scripts/ConfigureObservers.cs | 2 -- Assets/Scripts/ConfigureOrbital.cs | 18 ++---------------- Assets/Scripts/ConfigurePointer.cs | 4 ---- Assets/Scripts/DialogHandler.cs | 2 +- Assets/Scripts/EndpointLoader.cs | 5 ++--- Assets/Scripts/MdnsService.cs | 3 --- Assets/Scripts/ServiceDiscovery.cs | 2 -- Assets/Scripts/ServicesListPopulator.cs | 5 ++--- Assets/Scripts/VideoCaptureHandler.cs | 7 ++----- Assets/Scripts/WebViewBrowser.cs | 3 +-- 11 files changed, 10 insertions(+), 43 deletions(-) diff --git a/Assets/Scripts/ConfigureNavBar.cs b/Assets/Scripts/ConfigureNavBar.cs index 2418ad9..caa2bbe 100644 --- a/Assets/Scripts/ConfigureNavBar.cs +++ b/Assets/Scripts/ConfigureNavBar.cs @@ -1,8 +1,6 @@ -using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; -using UnityEngine.UI; public class ConfigureNavBar : MonoBehaviour { diff --git a/Assets/Scripts/ConfigureObservers.cs b/Assets/Scripts/ConfigureObservers.cs index 3a37e82..5fc7c2e 100644 --- a/Assets/Scripts/ConfigureObservers.cs +++ b/Assets/Scripts/ConfigureObservers.cs @@ -1,5 +1,3 @@ -using System.Collections; -using System.Collections.Generic; using Microsoft.MixedReality.Toolkit; using Microsoft.MixedReality.Toolkit.SpatialAwareness; using UnityEngine; diff --git a/Assets/Scripts/ConfigureOrbital.cs b/Assets/Scripts/ConfigureOrbital.cs index 77a2ffb..6bdf0da 100644 --- a/Assets/Scripts/ConfigureOrbital.cs +++ b/Assets/Scripts/ConfigureOrbital.cs @@ -1,8 +1,5 @@ -using System.Collections; -using System.Collections.Generic; -using Microsoft.MixedReality.Toolkit; -using Microsoft.MixedReality.Toolkit.Utilities; using Microsoft.MixedReality.Toolkit.Utilities.Solvers; +using System.Collections.Generic; using UnityEngine; public class ConfigureOrbital : MonoBehaviour @@ -70,18 +67,7 @@ public class ConfigureOrbital : MonoBehaviour cameraTransform.position + cameraTransform.TransformDirection(localOffset); canvas.transform.rotation = Quaternion.LookRotation(cameraTransform.forward, cameraTransform.up); - localOffset = new Vector3(localOffset.x + GetItemWidth(canvas), localOffset.y, localOffset.z); + localOffset = new Vector3(localOffset.x + endpointLoader.GetItemWidth(canvas), localOffset.y, localOffset.z); } } - - private float GetItemWidth(GameObject item) - { - RectTransform rectTransform = item.GetComponent(); - if (rectTransform != null) - { - return rectTransform.rect.width * rectTransform.lossyScale.x + 0.2f; - } - - return 0.8f; - } } diff --git a/Assets/Scripts/ConfigurePointer.cs b/Assets/Scripts/ConfigurePointer.cs index b6db54f..ed6aecc 100644 --- a/Assets/Scripts/ConfigurePointer.cs +++ b/Assets/Scripts/ConfigurePointer.cs @@ -1,8 +1,4 @@ -using System.Collections; -using System.Collections.Generic; -using Microsoft.MixedReality.Toolkit; using Microsoft.MixedReality.Toolkit.Input; -using Microsoft.MixedReality.Toolkit.Utilities; using UnityEngine; public class ConfigurePointer : MonoBehaviour diff --git a/Assets/Scripts/DialogHandler.cs b/Assets/Scripts/DialogHandler.cs index 1c981e9..ab55349 100644 --- a/Assets/Scripts/DialogHandler.cs +++ b/Assets/Scripts/DialogHandler.cs @@ -1,5 +1,5 @@ -using System; using Microsoft.MixedReality.Toolkit.UI; +using System; using UnityEngine; public class DialogHandler : MonoBehaviour diff --git a/Assets/Scripts/EndpointLoader.cs b/Assets/Scripts/EndpointLoader.cs index 6f7e449..d074fc2 100644 --- a/Assets/Scripts/EndpointLoader.cs +++ b/Assets/Scripts/EndpointLoader.cs @@ -1,10 +1,9 @@ +using Microsoft.MixedReality.WebView; using System; using System.Collections; using System.Collections.Generic; -using Microsoft.MixedReality.WebView; using UnityEngine; using UnityEngine.Networking; -using UnityEngine.UI; public class EndpointLoader : MonoBehaviour { @@ -89,7 +88,7 @@ public class EndpointLoader : MonoBehaviour } } - private float GetItemWidth(GameObject item) + public float GetItemWidth(GameObject item) { RectTransform rectTransform = item.GetComponent(); if (rectTransform != null) diff --git a/Assets/Scripts/MdnsService.cs b/Assets/Scripts/MdnsService.cs index 4a12523..ff24c1c 100644 --- a/Assets/Scripts/MdnsService.cs +++ b/Assets/Scripts/MdnsService.cs @@ -1,6 +1,3 @@ -using System.Collections; -using System.Collections.Generic; - public class MdnsService { public string IpAddress { get; } diff --git a/Assets/Scripts/ServiceDiscovery.cs b/Assets/Scripts/ServiceDiscovery.cs index 6c330b3..276c8ba 100644 --- a/Assets/Scripts/ServiceDiscovery.cs +++ b/Assets/Scripts/ServiceDiscovery.cs @@ -4,8 +4,6 @@ using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; using System.Text; -using System.Threading; -using System.Threading.Tasks; using UnityEngine; public class ServiceDiscovery : MonoBehaviour diff --git a/Assets/Scripts/ServicesListPopulator.cs b/Assets/Scripts/ServicesListPopulator.cs index 144a3a2..356420a 100644 --- a/Assets/Scripts/ServicesListPopulator.cs +++ b/Assets/Scripts/ServicesListPopulator.cs @@ -1,7 +1,6 @@ -using System; -using System.Collections; -using Microsoft.MixedReality.Toolkit.UI; +using Microsoft.MixedReality.Toolkit.UI; using Microsoft.MixedReality.Toolkit.Utilities; +using System; using TMPro; using UnityEngine; diff --git a/Assets/Scripts/VideoCaptureHandler.cs b/Assets/Scripts/VideoCaptureHandler.cs index 5e94d78..2e5102d 100644 --- a/Assets/Scripts/VideoCaptureHandler.cs +++ b/Assets/Scripts/VideoCaptureHandler.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; using Microsoft.MixedReality.Toolkit.UI; +using System; +using System.IO; using UnityEngine; using UnityEngine.Windows.WebCam; #if WINDOWS_UWP && !UNITY_EDITOR diff --git a/Assets/Scripts/WebViewBrowser.cs b/Assets/Scripts/WebViewBrowser.cs index 9ac18b1..18c2bf4 100644 --- a/Assets/Scripts/WebViewBrowser.cs +++ b/Assets/Scripts/WebViewBrowser.cs @@ -1,8 +1,7 @@ -using System; using Microsoft.MixedReality.WebView; +using System; using TMPro; using UnityEngine; -using UnityEngine.UI; public class WebViewBrowser : MonoBehaviour {