- Camera buttons on the host admin panel are functional. - Modem teleport effect fixed.
254 lines
6.0 KiB
C#
254 lines
6.0 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 PlayerPodium[] _PlayerPodiums;
|
|
[SerializeField] private CameraSystem_Console _CameraConsole;
|
|
|
|
private readonly Color _SelectedTabColour = new Color(0.0f, 0.5f, 0.0f);
|
|
|
|
|
|
public void ShowPlayersAdminView()
|
|
{
|
|
_GameConfigPanel.SetActive(true);
|
|
_CamerasPanel.SetActive(false);
|
|
|
|
_GameConfigButtonImage.color = _SelectedTabColour;
|
|
_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 = _SelectedTabColour;
|
|
|
|
_GameConfigButtonText.color = Color.black;
|
|
_CamerasButtonText.color = Color.white;
|
|
}
|
|
|
|
public void GameConfig_ShowRound1Panel()
|
|
{
|
|
_Round1Panel.SetActive(true);
|
|
_Round2Panel.SetActive(false);
|
|
_Round3Panel.SetActive(false);
|
|
|
|
_Round1ButtonImage.color = _SelectedTabColour;
|
|
_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 = _SelectedTabColour;
|
|
_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 = _SelectedTabColour;
|
|
|
|
_Round1ButtonText.color = Color.black;
|
|
_Round2ButtonText.color = Color.black;
|
|
_Round3ButtonText.color = Color.white;
|
|
}
|
|
|
|
|
|
public void Round1_Player1_ResetPodiumOwner()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[0],
|
|
NetworkEventTarget.All,
|
|
"ResetOwner");
|
|
}
|
|
public void Round1_Player2_ResetPodiumOwner()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[1],
|
|
NetworkEventTarget.All,
|
|
"ResetOwner");
|
|
}
|
|
public void Round1_Player3_ResetPodiumOwner()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[2],
|
|
NetworkEventTarget.All,
|
|
"ResetOwner");
|
|
}
|
|
|
|
public void Round1_Player1_DecreaseScoreBy5()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[0],
|
|
NetworkEventTarget.All,
|
|
"DecreaseScoreBy5");
|
|
}
|
|
public void Round1_Player2_DecreaseScoreBy5()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[1],
|
|
NetworkEventTarget.All,
|
|
"DecreaseScoreBy5");
|
|
}
|
|
public void Round1_Player3_DecreaseScoreBy5()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[2],
|
|
NetworkEventTarget.All,
|
|
"DecreaseScoreBy5");
|
|
}
|
|
|
|
public void Round1_Player1_IncreaseScoreBy5()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[0],
|
|
NetworkEventTarget.All,
|
|
"IncreaseScoreBy5");
|
|
}
|
|
public void Round1_Player2_IncreaseScoreBy5()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[1],
|
|
NetworkEventTarget.All,
|
|
"IncreaseScoreBy5");
|
|
}
|
|
public void Round1_Player3_IncreaseScoreBy5()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[2],
|
|
NetworkEventTarget.All,
|
|
"IncreaseScoreBy5");
|
|
}
|
|
|
|
public void Round1_Player1_ResetPodium()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[0],
|
|
NetworkEventTarget.All,
|
|
"ResetPodium");
|
|
}
|
|
public void Round1_Player2_ResetPodium()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[1],
|
|
NetworkEventTarget.All,
|
|
"ResetPodium");
|
|
}
|
|
public void Round1_Player3_ResetPodium()
|
|
{
|
|
NetworkCalling.SendCustomNetworkEvent(
|
|
(IUdonEventReceiver)_PlayerPodiums[2],
|
|
NetworkEventTarget.All,
|
|
"ResetPodium");
|
|
}
|
|
|
|
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();
|
|
}
|
|
}
|