wip
This commit is contained in:
@@ -11,6 +11,7 @@ using Unity.Netcode.Components;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using UnityEngine.UIElements;
|
||||
using Zenject;
|
||||
|
||||
public class PlayerComponent : NetworkBehaviour
|
||||
@@ -51,7 +52,6 @@ public class PlayerComponent : NetworkBehaviour
|
||||
|
||||
private bool isSoloRig => !networkObject.IsPlayerObject;
|
||||
private bool isLocalRig => networkObject.IsLocalPlayer;
|
||||
|
||||
private bool isRemoteRig => !networkObject.IsOwner && networkObject.IsPlayerObject;
|
||||
|
||||
// Teleport information after player is loaded into scene
|
||||
@@ -162,6 +162,13 @@ public class PlayerComponent : NetworkBehaviour
|
||||
|
||||
public void Teleport(Vector3 position, Vector3 direction)
|
||||
{
|
||||
StartCoroutine(TeleportAtTheEndOfFrame(position, direction));
|
||||
}
|
||||
|
||||
private IEnumerator TeleportAtTheEndOfFrame(Vector3 position, Vector3 direction)
|
||||
{
|
||||
yield return new WaitForEndOfFrame();
|
||||
|
||||
if (isLoaded)
|
||||
{
|
||||
teleporter.Teleport(position, direction);
|
||||
|
||||
Reference in New Issue
Block a user