Update to current Mirror

This commit is contained in:
MrGadget1024 2023-12-21 09:58:05 -05:00
parent 8e60e28ca3
commit f019ea1fd6
6 changed files with 21 additions and 16 deletions

View File

@ -9,8 +9,9 @@ public class NPCHandler : NetworkBehaviour
{
readonly static List<GameObject> NpcList = new List<GameObject>();
void OnValidate()
protected override void OnValidate()
{
base.OnValidate();
this.enabled = false;
}

View File

@ -14,10 +14,10 @@ public class NTRCustomSendInterval : NetworkTransformBase
[Tooltip("If we only sync on change, then we need to correct old snapshots if more time than sendInterval * multiplier has elapsed.\n\nOtherwise the first move will always start interpolating from the last move sequence's time, which will make it stutter when starting every time.")]
public float onlySyncOnChangeCorrectionMultiplier = 2;
[Header("Send Interval Multiplier")]
[Tooltip("Check/Sync every multiple of Network Manager send interval (= 1 / NM Send Rate), instead of every send interval.")]
[Range(1, 120)]
public uint sendIntervalMultiplier = 3;
//[Header("Send Interval Multiplier")]
//[Tooltip("Check/Sync every multiple of Network Manager send interval (= 1 / NM Send Rate), instead of every send interval.")]
//[Range(1, 120)]
//public uint sendIntervalMultiplier = 3;
[Header("Rotation")]
[Tooltip("Sensitivity of changes needed before an updated state is sent over the network")]
@ -459,13 +459,13 @@ static void RewriteHistory(
// insert a fake one at where we used to be,
// 'sendInterval' behind the new one.
SnapshotInterpolation.InsertIfNotExists(snapshots, new TransformSnapshot(
remoteTimeStamp - sendInterval, // arrival remote timestamp. NOT remote time.
localTime - sendInterval, // Unity 2019 doesn't have timeAsDouble yet
position,
rotation,
scale
));
//SnapshotInterpolation.InsertIfNotExists(snapshots, new TransformSnapshot(
// remoteTimeStamp - sendInterval, // arrival remote timestamp. NOT remote time.
// localTime - sendInterval, // Unity 2019 doesn't have timeAsDouble yet
// position,
// rotation,
// scale
//));
}
public override void Reset()

View File

@ -23,8 +23,9 @@ public class PlayerBuffers : NetworkBehaviour
public int serverSnapCount;
public int clientSnapCount;
private void OnValidate()
protected override void OnValidate()
{
base.OnValidate();
NTRCustomSendInterval = GetComponent<NTRCustomSendInterval>();
NetworkTransformReliable = GetComponent<NetworkTransformReliable>();

View File

@ -5,8 +5,9 @@ namespace TestNT
{
public class PlayerMinions : NetworkBehaviour
{
void OnValidate()
protected override void OnValidate()
{
base.OnValidate();
this.enabled = false;
}

View File

@ -61,8 +61,9 @@ public enum MoveMode : byte { Walking, Sneaking, Running };
public Vector3Int velocity;
public Vector3 direction;
void OnValidate()
protected override void OnValidate()
{
base.OnValidate();
if (NTR == null)
NTR = GetComponentInChildren<NTRCustomSendInterval>();

View File

@ -25,8 +25,9 @@ void OnNameChanged(string _, string newValue)
gameObject.name = newValue;
}
void OnValidate()
protected override void OnValidate()
{
base.OnValidate();
this.enabled = false;
}