Remove unused dependencies and reuse code

This commit is contained in:
Santiago Lo Coco 2024-11-11 22:33:10 +01:00
parent 6ace9a46c3
commit 7082141a70
11 changed files with 10 additions and 43 deletions

View File

@ -1,8 +1,6 @@
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
public class ConfigureNavBar : MonoBehaviour public class ConfigureNavBar : MonoBehaviour
{ {

View File

@ -1,5 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using Microsoft.MixedReality.Toolkit; using Microsoft.MixedReality.Toolkit;
using Microsoft.MixedReality.Toolkit.SpatialAwareness; using Microsoft.MixedReality.Toolkit.SpatialAwareness;
using UnityEngine; using UnityEngine;

View File

@ -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 Microsoft.MixedReality.Toolkit.Utilities.Solvers;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class ConfigureOrbital : MonoBehaviour public class ConfigureOrbital : MonoBehaviour
@ -70,18 +67,7 @@ public class ConfigureOrbital : MonoBehaviour
cameraTransform.position + cameraTransform.TransformDirection(localOffset); cameraTransform.position + cameraTransform.TransformDirection(localOffset);
canvas.transform.rotation = Quaternion.LookRotation(cameraTransform.forward, cameraTransform.up); 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<RectTransform>();
if (rectTransform != null)
{
return rectTransform.rect.width * rectTransform.lossyScale.x + 0.2f;
}
return 0.8f;
}
} }

View File

@ -1,8 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using Microsoft.MixedReality.Toolkit;
using Microsoft.MixedReality.Toolkit.Input; using Microsoft.MixedReality.Toolkit.Input;
using Microsoft.MixedReality.Toolkit.Utilities;
using UnityEngine; using UnityEngine;
public class ConfigurePointer : MonoBehaviour public class ConfigurePointer : MonoBehaviour

View File

@ -1,5 +1,5 @@
using System;
using Microsoft.MixedReality.Toolkit.UI; using Microsoft.MixedReality.Toolkit.UI;
using System;
using UnityEngine; using UnityEngine;
public class DialogHandler : MonoBehaviour public class DialogHandler : MonoBehaviour

View File

@ -1,10 +1,9 @@
using Microsoft.MixedReality.WebView;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.MixedReality.WebView;
using UnityEngine; using UnityEngine;
using UnityEngine.Networking; using UnityEngine.Networking;
using UnityEngine.UI;
public class EndpointLoader : MonoBehaviour 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<RectTransform>(); RectTransform rectTransform = item.GetComponent<RectTransform>();
if (rectTransform != null) if (rectTransform != null)

View File

@ -1,6 +1,3 @@
using System.Collections;
using System.Collections.Generic;
public class MdnsService public class MdnsService
{ {
public string IpAddress { get; } public string IpAddress { get; }

View File

@ -4,8 +4,6 @@ using System.Net;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using System.Net.Sockets; using System.Net.Sockets;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
public class ServiceDiscovery : MonoBehaviour public class ServiceDiscovery : MonoBehaviour

View File

@ -1,7 +1,6 @@
using System; using Microsoft.MixedReality.Toolkit.UI;
using System.Collections;
using Microsoft.MixedReality.Toolkit.UI;
using Microsoft.MixedReality.Toolkit.Utilities; using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;

View File

@ -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 Microsoft.MixedReality.Toolkit.UI;
using System;
using System.IO;
using UnityEngine; using UnityEngine;
using UnityEngine.Windows.WebCam; using UnityEngine.Windows.WebCam;
#if WINDOWS_UWP && !UNITY_EDITOR #if WINDOWS_UWP && !UNITY_EDITOR

View File

@ -1,8 +1,7 @@
using System;
using Microsoft.MixedReality.WebView; using Microsoft.MixedReality.WebView;
using System;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
public class WebViewBrowser : MonoBehaviour public class WebViewBrowser : MonoBehaviour
{ {