mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: TanksCoop example, reset host values. (#3660)
Added OnStopServer - nulls, to prevent a bug that can be caused on client host, when scenes do not reset during play, tank variables are set as "missing", which Unity does not count as null/empty.
This commit is contained in:
parent
a420e20d24
commit
d55967640f
@ -97,5 +97,13 @@ void OnOwnerChangedHook(NetworkIdentity _old, NetworkIdentity _new)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void OnStopServer()
|
||||
{
|
||||
// To prevent a bug that can be caused on client host, when scenes do not reset during play,
|
||||
// tank variables are set as "missing", which Unity does not count as null/empty.
|
||||
objectOwner = null;
|
||||
playerController = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user