1
0
mirror of https://projects.caleb-brown.dev/UDRI-XRT/UDRIGEEKCup2024.git synced 2025-01-22 15:18:25 -05:00
UDRIGEEKCup2024/Assets/Scripts/UIControler.cs
2024-04-23 11:14:59 -04:00

58 lines
1.6 KiB
C#

using UnityAtoms.BaseAtoms;
using UnityEngine;
using UnityEngine.XR.ARFoundation;
namespace MAVRIC.GEEKCup
{
public class UIControler : MonoBehaviour
{
[SerializeField] private GameObject[] CourseLayoutObjects;
[SerializeField] private GameObject[] GamePlayObjects;
[SerializeField] private ARPlaneManager arPlaneManager;
[SerializeField] private GameObject arPlanePrefab;
[SerializeField] private IntVariable scoreVariable;
[SerializeField] private GameLogic gameLogic;
[SerializeField] private GameObject trackables;
private void Start()
{
trackables = GameObject.Find("Trackables");
}
public void ShowCourseLayout()
{
foreach (var obj in CourseLayoutObjects)
{
obj.SetActive(true);
}
foreach (var obj in GamePlayObjects)
{
obj.SetActive(false);
}
setTrackablePlanes(true);
}
public void ShowGamePlay()
{
foreach (var obj in CourseLayoutObjects)
{
obj.SetActive(false);
}
foreach (var obj in GamePlayObjects)
{
obj.SetActive(true);
}
setTrackablePlanes(false);
scoreVariable.Value = 0;
gameLogic.CheckForSpawnPoint();
}
private void setTrackablePlanes(bool value)
{
trackables.SetActive(value);
}
}
}