mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
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:
parent
dd1a457f71
commit
e10ab75bf5
@ -25,7 +25,7 @@ int GetVisRange(NetworkIdentity identity)
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ServerCallback]
|
[ServerCallback]
|
||||||
public override void Reset()
|
public override void ResetState()
|
||||||
{
|
{
|
||||||
lastRebuildTime = 0D;
|
lastRebuildTime = 0D;
|
||||||
CustomRanges.Clear();
|
CustomRanges.Clear();
|
||||||
|
@ -72,7 +72,7 @@ public override void OnRebuildObservers(NetworkIdentity identity, HashSet<Networ
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ServerCallback]
|
[ServerCallback]
|
||||||
public override void Reset()
|
public override void ResetState()
|
||||||
{
|
{
|
||||||
lastRebuildTime = 0D;
|
lastRebuildTime = 0D;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ protected virtual void OnEnable()
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ServerCallback]
|
[ServerCallback]
|
||||||
public virtual void Reset() {}
|
public virtual void ResetState() {}
|
||||||
|
|
||||||
// Callback used by the visibility system to determine if an observer
|
// Callback used by the visibility system to determine if an observer
|
||||||
// (player) can see the NetworkIdentity. If this function returns true,
|
// (player) can see the NetworkIdentity. If this function returns true,
|
||||||
|
@ -161,7 +161,7 @@ static void Initialize()
|
|||||||
|
|
||||||
// reset Interest Management so that rebuild intervals
|
// reset Interest Management so that rebuild intervals
|
||||||
// start at 0 when starting again.
|
// start at 0 when starting again.
|
||||||
if (aoi != null) aoi.Reset();
|
if (aoi != null) aoi.ResetState();
|
||||||
|
|
||||||
// reset NetworkTime
|
// reset NetworkTime
|
||||||
NetworkTime.ResetStatics();
|
NetworkTime.ResetStatics();
|
||||||
@ -244,7 +244,7 @@ public static void Shutdown()
|
|||||||
OnDisconnectedEvent = null;
|
OnDisconnectedEvent = null;
|
||||||
OnErrorEvent = null;
|
OnErrorEvent = null;
|
||||||
|
|
||||||
if (aoi != null) aoi.Reset();
|
if (aoi != null) aoi.ResetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RemoveTransportHandlers()
|
static void RemoveTransportHandlers()
|
||||||
|
@ -75,7 +75,7 @@ public class #SCRIPTNAME# : InterestManagement
|
|||||||
/// Called by NetworkServer in Initialize and Shutdown
|
/// Called by NetworkServer in Initialize and Shutdown
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ServerCallback]
|
[ServerCallback]
|
||||||
public override void Reset() { }
|
public override void ResetState() { }
|
||||||
|
|
||||||
[ServerCallback]
|
[ServerCallback]
|
||||||
void Update()
|
void Update()
|
||||||
|
Loading…
Reference in New Issue
Block a user