EVERYTHING
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Photon.Pun;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlockSpace.Worlds
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class FallResetTeleport : MonoBehaviourPunCallbacks
|
||||
{
|
||||
[SerializeField]
|
||||
private float yKillPlane = -2000f;
|
||||
|
||||
[SerializeField]
|
||||
private Vector3 respawnPosition = new Vector3(0f, 5f, 0f);
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (PhotonNetwork.InRoom && PhotonNetwork.LocalPlayer != null)
|
||||
{
|
||||
Transform localVrTeleportRoot = PlayerTeleportUtil.GetLocalVrTeleportRoot();
|
||||
Vector3 obj = ((localVrTeleportRoot != null) ? localVrTeleportRoot.position : base.transform.position);
|
||||
if (!(obj.y >= yKillPlane))
|
||||
{
|
||||
PlayerTeleportUtil.TryTeleportLocalPlayer(respawnPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user