CarmenSandiego/Assets/UdonSharp/PlayerTeleporter.cs
Jamie Greunbaum 2bf76f34cd Oh, boy, there's a lot here.
- Added a functioning Modem.
- Added a destination sign at the Modem's destination location.
- Intro video transcripts are now optional in case files.
- Added a proper endgame handler for round 1.
- Fixed a lot of formatting for text between rounds.
- Fixed a bug that showed the wrong text if all round 3 markers are exhausted.
- Shortened time to detect improperly placed markers by just a bit.
2025-08-18 04:19:21 -04:00

51 lines
1.4 KiB
C#

using UdonSharp;
using UnityEngine;
using VRC.SDK3.UdonNetworkCalling;
using VRC.SDKBase;
using VRC.Udon;
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
public class PlayerTeleporter : UdonSharpBehaviour
{
[SerializeField] private Transform _HostTeleportLocation;
[SerializeField] private Transform _Player1TeleportLocation;
[SerializeField] private Transform _Player2TeleportLocation;
[SerializeField] private Transform _Player3TeleportLocation;
[SerializeField] private Transform _AudienceTeleportLocation;
[Space]
[SerializeField] private PlayerPodium[] _PlayerPodiums;
public void TeleportToHostPosition()
{
Networking.LocalPlayer.TeleportTo(_HostTeleportLocation.position, _HostTeleportLocation.rotation);
}
public void TeleportToPlayer1Position()
{
Networking.LocalPlayer.TeleportTo(_Player1TeleportLocation.position, _Player1TeleportLocation.rotation);
_PlayerPodiums[0].SetPlayerName();
}
public void TeleportToPlayer2Position()
{
Networking.LocalPlayer.TeleportTo(_Player2TeleportLocation.position, _Player2TeleportLocation.rotation);
_PlayerPodiums[1].SetPlayerName();
}
public void TeleportToPlayer3Position()
{
Networking.LocalPlayer.TeleportTo(_Player3TeleportLocation.position, _Player3TeleportLocation.rotation);
_PlayerPodiums[2].SetPlayerName();
}
public void TeleportToAudience()
{
Networking.LocalPlayer.TeleportTo(_AudienceTeleportLocation.position, _AudienceTeleportLocation.rotation);
}
}