-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Changed GeneratedComparer<T> renamed to PublicPropertyComparer<T>. - Fixed PredictionManager.RedundancyCount being different between WebGL and server builds. - Fixed Prediction 2 states not splitting properly when large. - Improved simplified IntermediateLayer. - Added Tugboat IPv6 toggling. (#566) - Added Tugboat DontRoute. (#540) - Changed Prediction 2 ReplicateV2 and ReconcileV2 renamed to Replicate and Reconcile. - Improved demo scenes now use their own prefab collection lists. (#549) - Fixed Prediction 1 demo scene prefabs. (#552) - Added Server/ClientManager.SetFrameRate. - Fixed OnStopNetworking calling on clientHost before client was able to deinitialize. - Fixed SyncTypes not clearing dirty state when values were written for despawn. (#574) - Improved updated PredictedObject.Rigidbodies API for Unity 2021. - Improved SyncTypes of collections no longer allocate during initialization. - Fixed jitter on Prediction 2 smoothing. - Added a variety of GetXYZMoveRates functions to MoveRates. - Added MoveRates and MoveRatesCls.MoveToTarget. - Removed MoveRatesCls.Multiply - Improved exposed SyncVar.SetInitialValues. - Added NetworkManager.GetPooledInstantiated makeActive and parent options. - Added ObjectPool.RetrievObject makeActive and parent options. - Fixed transform values being applied incorrectly during spawns. - Fixed possible memory leak if an object was stored to DefaultObjectPool then destroyed, and object pool was never used afterwards. - Changed Prediction V2 PredictionManager.IsReplaying() renamed to PredictionManager.IsReconciling(). - Fixed Prediction V2 calling dispose on replicate datas early. - Added Prediction V2 PredictionManager.ClientReplayTick. - Added Prediction V2 PredictionManager.ServerReplayTick. - Added Prediction V2 PredictionManager.ClientStateTick. - Added Prediction V2 PredictionManager.ServerStateTick. - Added Prediction V2 NetworkBehaviour.IsReconiling. - Added NetworkBehaviour.Write/ReadPayload. - Removed SyncType forwarding for predicted spawns; Write/ReadPayload should now be used. - Added Writer/ReaderPool.StoreAndDefault. - Fixed Unity stripping necessary NetworkTransform code for Android builds. - Changed FishNet\Plugins is now reserved for user imported plugins. Internal plugins have been moved to FishNet\Runtime\Plugins.
- Loading branch information
FirstGearGames
committed
Jan 26, 2024
1 parent
16499f1
commit 71950d1
Showing
88 changed files
with
7,490 additions
and
7,479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 16 additions & 16 deletions
32
Assets/FishNet/Demos/ColliderRollback/Scripts/DestroyAfterDelay.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
using UnityEngine; | ||
|
||
namespace FishNet.Example.ColliderRollbacks | ||
{ | ||
public class DestroyAfterDelay : MonoBehaviour | ||
{ | ||
[SerializeField] | ||
private float _delay = 1f; | ||
|
||
private void Awake() | ||
{ | ||
Destroy(gameObject, _delay); | ||
} | ||
|
||
} | ||
|
||
using UnityEngine; | ||
|
||
namespace FishNet.Example.ColliderRollbacks | ||
{ | ||
public class DestroyAfterDelay : MonoBehaviour | ||
{ | ||
[SerializeField] | ||
private float _delay = 1f; | ||
|
||
private void Awake() | ||
{ | ||
Destroy(gameObject, _delay); | ||
} | ||
|
||
} | ||
|
||
} |
132 changes: 66 additions & 66 deletions
132
Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Aim.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,67 @@ | ||
using FishNet.Object; | ||
using UnityEngine; | ||
|
||
|
||
namespace FishNet.Example.ColliderRollbacks | ||
{ | ||
|
||
/// <summary> | ||
/// DEMO. CODE IS NOT OPTIMIZED. | ||
/// Aims the camera. | ||
/// </summary> | ||
public class Aim : NetworkBehaviour | ||
{ | ||
|
||
public PlayerCamera PlayerCamera { get; private set; } | ||
private readonly Vector3 _offset = new Vector3(0f, 1.65f, 0f); | ||
|
||
public override void OnStartClient() | ||
{ | ||
if (base.IsOwner) | ||
PlayerCamera = Camera.main.transform.GetComponent<PlayerCamera>(); | ||
} | ||
|
||
private void Update() | ||
{ | ||
if (!base.IsOwner || PlayerCamera == null) | ||
return; | ||
|
||
Cursor.lockState = CursorLockMode.Locked; | ||
Cursor.visible = false; | ||
MoveAim(); | ||
MoveCamera(); | ||
} | ||
|
||
/// <summary> | ||
/// Aims camera. | ||
/// </summary> | ||
private void MoveAim() | ||
{ | ||
float speed = 2f; | ||
//Yaw. | ||
transform.Rotate(new Vector3(0f, Input.GetAxis("Mouse X") * speed, 0f)); | ||
//Pitch. | ||
float pitch = PlayerCamera.transform.eulerAngles.x - (Input.GetAxis("Mouse Y") * speed); | ||
/* If not signed on X then make it | ||
* signed for easy clamping. */ | ||
if (pitch > 180f) | ||
pitch -= 360f; | ||
pitch = Mathf.Clamp(pitch, -89f, 89f); | ||
|
||
PlayerCamera.transform.eulerAngles = new Vector3(pitch, transform.eulerAngles.y, transform.eulerAngles.z); | ||
} | ||
|
||
/// <summary> | ||
/// Moves camera. | ||
/// </summary> | ||
private void MoveCamera() | ||
{ | ||
PlayerCamera.transform.position = transform.position + _offset; | ||
PlayerCamera.transform.rotation = Quaternion.Euler(PlayerCamera.transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z); | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
using FishNet.Object; | ||
using UnityEngine; | ||
|
||
|
||
namespace FishNet.Example.ColliderRollbacks | ||
{ | ||
|
||
/// <summary> | ||
/// DEMO. CODE IS NOT OPTIMIZED. | ||
/// Aims the camera. | ||
/// </summary> | ||
public class Aim : NetworkBehaviour | ||
{ | ||
|
||
public PlayerCamera PlayerCamera { get; private set; } | ||
private readonly Vector3 _offset = new Vector3(0f, 1.65f, 0f); | ||
|
||
public override void OnStartClient() | ||
{ | ||
if (base.IsOwner) | ||
PlayerCamera = Camera.main.transform.GetComponent<PlayerCamera>(); | ||
} | ||
|
||
private void Update() | ||
{ | ||
if (!base.IsOwner || PlayerCamera == null) | ||
return; | ||
|
||
Cursor.lockState = CursorLockMode.Locked; | ||
Cursor.visible = false; | ||
MoveAim(); | ||
MoveCamera(); | ||
} | ||
|
||
/// <summary> | ||
/// Aims camera. | ||
/// </summary> | ||
private void MoveAim() | ||
{ | ||
float speed = 2f; | ||
//Yaw. | ||
transform.Rotate(new Vector3(0f, Input.GetAxis("Mouse X") * speed, 0f)); | ||
//Pitch. | ||
float pitch = PlayerCamera.transform.eulerAngles.x - (Input.GetAxis("Mouse Y") * speed); | ||
/* If not signed on X then make it | ||
* signed for easy clamping. */ | ||
if (pitch > 180f) | ||
pitch -= 360f; | ||
pitch = Mathf.Clamp(pitch, -89f, 89f); | ||
|
||
PlayerCamera.transform.eulerAngles = new Vector3(pitch, transform.eulerAngles.y, transform.eulerAngles.z); | ||
} | ||
|
||
/// <summary> | ||
/// Moves camera. | ||
/// </summary> | ||
private void MoveCamera() | ||
{ | ||
PlayerCamera.transform.position = transform.position + _offset; | ||
PlayerCamera.transform.rotation = Quaternion.Euler(PlayerCamera.transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z); | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
} |
44 changes: 22 additions & 22 deletions
44
Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Fire.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
using FishNet.Component.ColliderRollback; | ||
using FishNet.Managing.Timing; | ||
using FishNet.Object; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using UnityEngine; | ||
|
||
|
||
namespace FishNet.Example.ColliderRollbacks | ||
{ | ||
|
||
/// <summary> | ||
/// DEMO. CODE IS NOT OPTIMIZED. | ||
/// Fires at objects. | ||
/// </summary> | ||
public class Fire : NetworkBehaviour | ||
{ | ||
|
||
|
||
} | ||
} | ||
|
||
using FishNet.Component.ColliderRollback; | ||
using FishNet.Managing.Timing; | ||
using FishNet.Object; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using UnityEngine; | ||
|
||
|
||
namespace FishNet.Example.ColliderRollbacks | ||
{ | ||
|
||
/// <summary> | ||
/// DEMO. CODE IS NOT OPTIMIZED. | ||
/// Fires at objects. | ||
/// </summary> | ||
public class Fire : NetworkBehaviour | ||
{ | ||
|
||
|
||
} | ||
} | ||
36 changes: 18 additions & 18 deletions
36
Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerCamera.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
using UnityEngine; | ||
|
||
namespace FishNet.Example.ColliderRollbacks | ||
{ | ||
|
||
/// <summary> | ||
/// DEMO. CODE IS NOT OPTIMIZED. | ||
/// Doesn't do much... | ||
/// </summary> | ||
public class PlayerCamera : MonoBehaviour | ||
{ | ||
/// <summary> | ||
/// MuzzleFlash on the weapon. | ||
/// </summary> | ||
public Transform MuzzleFlash; | ||
|
||
} | ||
|
||
using UnityEngine; | ||
|
||
namespace FishNet.Example.ColliderRollbacks | ||
{ | ||
|
||
/// <summary> | ||
/// DEMO. CODE IS NOT OPTIMIZED. | ||
/// Doesn't do much... | ||
/// </summary> | ||
public class PlayerCamera : MonoBehaviour | ||
{ | ||
/// <summary> | ||
/// MuzzleFlash on the weapon. | ||
/// </summary> | ||
public Transform MuzzleFlash; | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.