Jamie Greunbaum 69337bf3de - Added fence, barrel, trash can, and cardboard boxes to the alleyway.
- Added more light probes to alleyway.
- Added round 2 podium reset buttons to admin panel.
- Fixed ResetPodium function not having a parameter in PlayerPodiumRound2.
2026-04-28 05:10:40 -04:00

277 lines
6.7 KiB
C#

using CameraSystem;
using TMPro;
using UdonSharp;
using UnityEngine;
using UnityEngine.UI;
using VRC.SDK3.UdonNetworkCalling;
using VRC.Udon.Common.Interfaces;
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
public class HostPanelInterface : UdonSharpBehaviour
{
[SerializeField] private HostCardManager _HostCard;
[Space]
[SerializeField] private GameObject _GameConfigPanel;
[SerializeField] private GameObject _CamerasPanel;
[SerializeField] private GameObject _Round1Panel;
[SerializeField] private GameObject _Round2Panel;
[SerializeField] private GameObject _Round3Panel;
[Space]
[SerializeField] private Image _GameConfigButtonImage;
[SerializeField] private Image _CamerasButtonImage;
[SerializeField] private Image _Round1ButtonImage;
[SerializeField] private Image _Round2ButtonImage;
[SerializeField] private Image _Round3ButtonImage;
[Space]
[SerializeField] private TextMeshProUGUI _GameConfigButtonText;
[SerializeField] private TextMeshProUGUI _CamerasButtonText;
[SerializeField] private TextMeshProUGUI _Round1ButtonText;
[SerializeField] private TextMeshProUGUI _Round2ButtonText;
[SerializeField] private TextMeshProUGUI _Round3ButtonText;
[Space]
[SerializeField] private CaseManager _CaseManager;
[SerializeField] private CameraSystem_Console _CameraConsole;
[Space]
[Header("Round 1")]
[SerializeField] private GameManagerRound1 _Round1Manager;
[SerializeField] private PlayerPodium[] _Round1Podiums;
[Space]
[Header("Round 2")]
[SerializeField] private GameManagerRound2 _Round2Manager;
[SerializeField] private PlayerPodiumRound2[] _Round2Podiums;
[Space]
[Header("Round 3")]
[SerializeField] private GameManagerRound3 _Round3Manager;
private readonly Color SELECTED_TAB_COLOUR = new Color(0.0f, 0.5f, 0.0f);
public void ShowPlayersAdminView()
{
_GameConfigPanel.SetActive(true);
_CamerasPanel.SetActive(false);
_GameConfigButtonImage.color = SELECTED_TAB_COLOUR;
_CamerasButtonImage.color = Color.white;
_GameConfigButtonText.color = Color.white;
_CamerasButtonText.color = Color.black;
}
public void ShowCamerasAdminView()
{
_GameConfigPanel.SetActive(false);
_CamerasPanel.SetActive(true);
_GameConfigButtonImage.color = Color.white;
_CamerasButtonImage.color = SELECTED_TAB_COLOUR;
_GameConfigButtonText.color = Color.black;
_CamerasButtonText.color = Color.white;
}
public void GameConfig_ShowRound1Panel()
{
_Round1Panel.SetActive(true);
_Round2Panel.SetActive(false);
_Round3Panel.SetActive(false);
_Round1ButtonImage.color = SELECTED_TAB_COLOUR;
_Round2ButtonImage.color = Color.white;
_Round3ButtonImage.color = Color.white;
_Round1ButtonText.color = Color.white;
_Round2ButtonText.color = Color.black;
_Round3ButtonText.color = Color.black;
}
public void GameConfig_ShowRound2Panel()
{
_Round1Panel.SetActive(false);
_Round2Panel.SetActive(true);
_Round3Panel.SetActive(false);
_Round1ButtonImage.color = Color.white;
_Round2ButtonImage.color = SELECTED_TAB_COLOUR;
_Round3ButtonImage.color = Color.white;
_Round1ButtonText.color = Color.black;
_Round2ButtonText.color = Color.white;
_Round3ButtonText.color = Color.black;
}
public void GameConfig_ShowRound3Panel()
{
_Round1Panel.SetActive(false);
_Round2Panel.SetActive(false);
_Round3Panel.SetActive(true);
_Round1ButtonImage.color = Color.white;
_Round2ButtonImage.color = Color.white;
_Round3ButtonImage.color = SELECTED_TAB_COLOUR;
_Round1ButtonText.color = Color.black;
_Round2ButtonText.color = Color.black;
_Round3ButtonText.color = Color.white;
}
public void Round1_Player1_ResetPodiumOwner()
{
_Round1Podiums[0].SendCustomNetworkEvent(NetworkEventTarget.Owner, "ResetOwner");
}
public void Round1_Player2_ResetPodiumOwner()
{
_Round1Podiums[1].SendCustomNetworkEvent(NetworkEventTarget.Owner, "ResetOwner");
}
public void Round1_Player3_ResetPodiumOwner()
{
_Round1Podiums[2].SendCustomNetworkEvent(NetworkEventTarget.Owner, "ResetOwner");
}
public void Round1_Player1_DecreaseScoreBy5()
{
_Round1Podiums[0].SendCustomNetworkEvent(NetworkEventTarget.Owner, "AdjustScore", -5);
}
public void Round1_Player2_DecreaseScoreBy5()
{
_Round1Podiums[1].SendCustomNetworkEvent(NetworkEventTarget.Owner, "AdjustScore", -5);
}
public void Round1_Player3_DecreaseScoreBy5()
{
_Round1Podiums[2].SendCustomNetworkEvent(NetworkEventTarget.Owner, "AdjustScore", -5);
}
public void Round1_Player1_IncreaseScoreBy5()
{
_Round1Podiums[0].SendCustomNetworkEvent(NetworkEventTarget.Owner, "AdjustScore", 5);
}
public void Round1_Player2_IncreaseScoreBy5()
{
_Round1Podiums[1].SendCustomNetworkEvent(NetworkEventTarget.Owner, "AdjustScore", 5);
}
public void Round1_Player3_IncreaseScoreBy5()
{
_Round1Podiums[2].SendCustomNetworkEvent(NetworkEventTarget.Owner, "AdjustScore", 5);
}
public void Round1_Player1_ResetPodium()
{
_Round1Podiums[0].SendCustomNetworkEvent(NetworkEventTarget.Owner, "ResetPodium");
}
public void Round1_Player2_ResetPodium()
{
_Round1Podiums[1].SendCustomNetworkEvent(NetworkEventTarget.Owner, "ResetPodium");
}
public void Round1_Player3_ResetPodium()
{
_Round1Podiums[2].SendCustomNetworkEvent(NetworkEventTarget.Owner, "ResetPodium");
}
public void Round2_Player1_ResetOwner()
{
Debug.Log("[HostPanelInterface] Resetting owner of Player 1 podium.");
_Round2Podiums[0].ResetOwner(true);
}
public void Round2_Player2_ResetOwner()
{
Debug.Log("[HostPanelInterface] Resetting owner of Player 2 podium.");
_Round2Podiums[1].ResetOwner(true);
}
public void Round2_Player1_ResetPodium()
{
Debug.Log("[HostPanelInterface] Resetting Player 1 podium.");
_Round2Podiums[0].ResetPodium(true);
}
public void Round2_Player2_ResetPodium()
{
Debug.Log("[HostPanelInterface] Resetting Player 2 podium.");
_Round2Podiums[1].ResetPodium(true);
}
public void Round3_RandomiseMap_Easy()
{
_Round3Manager.RerandomiseMap(false);
}
public void Round3_RandomiseMap_Hard()
{
_Round3Manager.RerandomiseMap(true);
}
public void Round3_EndTimerEarly()
{
_Round3Manager.EndTimerEarly();
}
public void RestartRound1()
{
_CaseManager.ContinueToRound1();
}
public void RestartRound2()
{
_CaseManager.ContinueToRound2();
}
public void RestartRound3()
{
_CaseManager.ContinueToRound3();
}
public void Camera1_Switch()
{
_CameraConsole.SendLiveCamera1();
}
public void Camera2_Switch()
{
_CameraConsole.SendLiveCamera2();
}
public void Camera3_Switch()
{
_CameraConsole.SendLiveCamera3();
}
public void Camera4_Switch()
{
_CameraConsole.SendLiveCamera4();
}
public void Camera5_Switch()
{
_CameraConsole.SendLiveCamera5();
}
public void Camera6_Switch()
{
_CameraConsole.SendLiveCamera6();
}
public void TogglePotato()
{
_CameraConsole.TogglePotato();
}
}