Added leveler
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using Unity.Netcode;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public sealed class PlayerCarryController : NetworkBehaviour, IPlayerSystem
|
||||
{
|
||||
private bool isInitialized;
|
||||
|
||||
public void Initialize(PlayerFacade facade)
|
||||
{
|
||||
isInitialized = true;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!isInitialized || !IsOwner || Keyboard.current == null)
|
||||
return;
|
||||
|
||||
if (Keyboard.current.gKey.wasPressedThisFrame &&
|
||||
NetworkHeldInteractable.TryGetHeldObject(
|
||||
OwnerClientId,
|
||||
out NetworkHeldInteractable heldObject))
|
||||
{
|
||||
heldObject.RequestThrow();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user