mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix(Additive Levels Example): Simplified Portal::SendPlayerToNewScene
This commit is contained in:
parent
c1b5053004
commit
80df4d66b6
@ -60,8 +60,8 @@ void OnTriggerEnter(Collider other)
|
|||||||
[ServerCallback]
|
[ServerCallback]
|
||||||
IEnumerator SendPlayerToNewScene(GameObject player)
|
IEnumerator SendPlayerToNewScene(GameObject player)
|
||||||
{
|
{
|
||||||
if (player.TryGetComponent(out NetworkIdentity identity))
|
if (!player.TryGetComponent(out NetworkIdentity identity)) yield break;
|
||||||
{
|
|
||||||
NetworkConnectionToClient conn = identity.connectionToClient;
|
NetworkConnectionToClient conn = identity.connectionToClient;
|
||||||
if (conn == null) yield break;
|
if (conn == null) yield break;
|
||||||
|
|
||||||
@ -98,4 +98,3 @@ IEnumerator SendPlayerToNewScene(GameObject player)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user