mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkTransformBase - OnClientAuthorityChanged is Server Only
This commit is contained in:
parent
2239bb0245
commit
22ac763199
@ -281,15 +281,20 @@ public virtual void Reset()
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
Reset();
|
||||
NetworkIdentity.clientAuthorityCallback += OnClientAuthorityChanged;
|
||||
|
||||
if (NetworkServer.active)
|
||||
NetworkIdentity.clientAuthorityCallback += OnClientAuthorityChanged;
|
||||
}
|
||||
|
||||
protected virtual void OnDisable()
|
||||
{
|
||||
Reset();
|
||||
NetworkIdentity.clientAuthorityCallback -= OnClientAuthorityChanged;
|
||||
|
||||
if (NetworkServer.active)
|
||||
NetworkIdentity.clientAuthorityCallback -= OnClientAuthorityChanged;
|
||||
}
|
||||
|
||||
[ServerCallback]
|
||||
void OnClientAuthorityChanged(NetworkConnectionToClient conn, NetworkIdentity identity, bool authorityState)
|
||||
{
|
||||
if (identity != netIdentity) return;
|
||||
|
Loading…
Reference in New Issue
Block a user