CarmenSandiego/Assets/UdonSharp/PlayerTeleporter.cs
Jamie Greunbaum a428d0b126 - Player platforms now function exactly as intended.
- Raised floor height of Round 1, and added wood beams around the edge.
- Improved lightmap quality without increasing size.
2025-09-04 19:06:32 -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()
{
_PlayerPodiums[0].SetPlayerName();
Networking.LocalPlayer.TeleportTo(_Player1TeleportLocation.position, _Player1TeleportLocation.rotation);
}
public void TeleportToPlayer2Position()
{
_PlayerPodiums[1].SetPlayerName();
Networking.LocalPlayer.TeleportTo(_Player2TeleportLocation.position, _Player2TeleportLocation.rotation);
}
public void TeleportToPlayer3Position()
{
_PlayerPodiums[2].SetPlayerName();
Networking.LocalPlayer.TeleportTo(_Player3TeleportLocation.position, _Player3TeleportLocation.rotation);
}
public void TeleportToAudience()
{
Networking.LocalPlayer.TeleportTo(_AudienceTeleportLocation.position, _AudienceTeleportLocation.rotation);
}
}