Added Furnance and smelting
This commit is contained in:
@@ -60,6 +60,24 @@ public sealed class FirstPersonCameraController : NetworkBehaviour, IPlayerSyste
|
||||
|
||||
if (isInitialized && !IsOwner)
|
||||
ApplyCameraPitch(synchronizedPitch.Value);
|
||||
|
||||
if (isInitialized && IsOwner)
|
||||
CaptureCursor();
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (!isInitialized || !IsOwner || !Application.isFocused)
|
||||
return;
|
||||
|
||||
if (Cursor.lockState != CursorLockMode.Locked || Cursor.visible)
|
||||
CaptureCursor();
|
||||
}
|
||||
|
||||
private void OnApplicationFocus(bool hasFocus)
|
||||
{
|
||||
if (hasFocus && isInitialized && IsOwner)
|
||||
CaptureCursor();
|
||||
}
|
||||
|
||||
public void ApplyPitch(float pitchDelta)
|
||||
@@ -98,4 +116,10 @@ public sealed class FirstPersonCameraController : NetworkBehaviour, IPlayerSyste
|
||||
if (playerCamera != null)
|
||||
playerCamera.transform.localRotation = Quaternion.Euler(pitch, 0f, 0f);
|
||||
}
|
||||
|
||||
private static void CaptureCursor()
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
Cursor.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user