Read the description for detailed changes.

- Added `Sandbox.Players`: a synchronized list of `NetworkPlayerId` structs representing connected players.
- Added `Sandbox.Events.OnPlayerJoined` and `Sandbox.Events.OnPlayerLeft` callbacks, synchronized across all clients.
- Changed internal interpolation of quaternions to use `Slerp` instead of `Lerp`.
- Fixed a potential crash caused by undefined behavior when reaching `NetickConfig.MaxPlayers` and destroying network objects.
- Fixed an issue where sandbox-loaded scenes were not being unloaded during shutdown.
- Fixed a bug preventing Prediction Error Correction from functioning correctly.
This commit is contained in:
Karrar
2025-06-27 05:47:00 +03:00
parent 8e2db0f357
commit 1b0d33d8f0
25 changed files with 1843 additions and 1529 deletions

View File

@@ -4,22 +4,22 @@ using Netick.Unity;
namespace Netick.Samples.Bomberman
{
public class Block : NetworkBehaviour
public class Block : NetworkBehaviour
{
// Networked Properties
[Networked]
public NetworkBool Visible { get; set; } = true;
[OnChanged(nameof(Visible))]
private void OnVisibleChanged(OnChangedData onChangedData)
{
// Networked Properties
[Networked]
public NetworkBool Visible { get; set; } = true;
// for visual components, don't use "enabled" property when you want to disable/enable it, instead use SetEnabled().
// -- GetComponent<Renderer>().enabled = Visible; #### Not like this.
[OnChanged(nameof(Visible))]
private void OnVisibleChanged(OnChangedData onChangedData)
{
// for visual components, don't use "enabled" property when you want to disable/enable it, instead use SetEnabled().
// -- GetComponent<Renderer>().enabled = Visible; #### Not like this.
GetComponent<Renderer>().SetEnabled(Sandbox, Visible); // #### Like this.
GetComponent<Renderer>().SetEnabled(Sandbox, Visible); // #### Like this.
GetComponent<BoxCollider>().enabled = Visible;
}
GetComponent<BoxCollider>().enabled = Visible;
}
}
}