mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
syntax
This commit is contained in:
parent
94707b2554
commit
294fd46146
@ -655,6 +655,26 @@ internal void OnStartClient()
|
||||
}
|
||||
}
|
||||
|
||||
internal void OnStopClient()
|
||||
{
|
||||
foreach (NetworkBehaviour comp in NetworkBehaviours)
|
||||
{
|
||||
// an exception in OnStopClient should be caught, so that
|
||||
// one component's exception doesn't stop all other components
|
||||
// from being initialized
|
||||
// => this is what Unity does for Start() etc. too.
|
||||
// one exception doesn't stop all the other Start() calls!
|
||||
try
|
||||
{
|
||||
comp.OnStopClient();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("Exception in OnStopClient:" + e.Message + " " + e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO why is this static? find out, add a comment, or make it not static.
|
||||
static NetworkIdentity previousLocalPlayer = null;
|
||||
internal void OnStartLocalPlayer()
|
||||
@ -754,26 +774,6 @@ internal void OnSetHostVisibility(bool visible)
|
||||
rend.enabled = visible;
|
||||
}
|
||||
|
||||
internal void OnStopClient()
|
||||
{
|
||||
foreach (NetworkBehaviour comp in NetworkBehaviours)
|
||||
{
|
||||
// an exception in OnStopClient should be caught, so that
|
||||
// one component's exception doesn't stop all other components
|
||||
// from being initialized
|
||||
// => this is what Unity does for Start() etc. too.
|
||||
// one exception doesn't stop all the other Start() calls!
|
||||
try
|
||||
{
|
||||
comp.OnStopClient();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("Exception in OnStopClient:" + e.Message + " " + e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// vis2k: readstring bug prevention: https://issuetracker.unity3d.com/issues/unet-networkwriter-dot-write-causing-readstring-slash-readbytes-out-of-range-errors-in-clients
|
||||
// -> OnSerialize writes length,componentData,length,componentData,...
|
||||
// -> OnDeserialize carefully extracts each data, then deserializes each component with separate readers
|
||||
|
Loading…
Reference in New Issue
Block a user