fix(InterestManagement): Separate ResetState (#3743)

* fix(InterestManagement): Separate ResetState
We should not have hijacked Unity's callback for runtime resets.

* Updated Template
This commit is contained in:
MrGadget 2024-01-20 04:46:29 -05:00 committed by GitHub
parent dd1a457f71
commit e10ab75bf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,7 @@ int GetVisRange(NetworkIdentity identity)
}
[ServerCallback]
public override void Reset()
public override void ResetState()
{
lastRebuildTime = 0D;
CustomRanges.Clear();

View File

@ -72,7 +72,7 @@ public override void OnRebuildObservers(NetworkIdentity identity, HashSet<Networ
}
[ServerCallback]
public override void Reset()
public override void ResetState()
{
lastRebuildTime = 0D;
}

View File

@ -23,7 +23,7 @@ protected virtual void OnEnable()
}
[ServerCallback]
public virtual void Reset() {}
public virtual void ResetState() {}
// Callback used by the visibility system to determine if an observer
// (player) can see the NetworkIdentity. If this function returns true,

View File

@ -161,7 +161,7 @@ static void Initialize()
// reset Interest Management so that rebuild intervals
// start at 0 when starting again.
if (aoi != null) aoi.Reset();
if (aoi != null) aoi.ResetState();
// reset NetworkTime
NetworkTime.ResetStatics();
@ -244,7 +244,7 @@ public static void Shutdown()
OnDisconnectedEvent = null;
OnErrorEvent = null;
if (aoi != null) aoi.Reset();
if (aoi != null) aoi.ResetState();
}
static void RemoveTransportHandlers()

View File

@ -75,7 +75,7 @@ public class #SCRIPTNAME# : InterestManagement
/// Called by NetworkServer in Initialize and Shutdown
/// </summary>
[ServerCallback]
public override void Reset() { }
public override void ResetState() { }
[ServerCallback]
void Update()