CarmenSandiego/Assets/UdonSharp/PlayerTeleporter.cs
Jamie Greunbaum fd6eed9adc - Started work on proper lighting for the sets.
- Did a bit more work on the ACME Crimenet Computer.
2025-08-10 05:00:46 -04:00

54 lines
1.5 KiB
C#

using UdonSharp;
using UnityEngine;
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;
[Space]
[SerializeField] private Transform _ModemArrivalsTeleportLocation;
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);
}
}