This commit is contained in:
2025-06-16 15:14:23 +02:00
commit 074e590073
3174 changed files with 428263 additions and 0 deletions

View File

@ -0,0 +1,22 @@
using UnityEngine;
using Mirror;
namespace Mirror.Examples.CharacterSelection
{
public class PlayerEmpty : NetworkBehaviour
{
private SceneReferencer sceneReferencer;
public override void OnStartAuthority()
{
// enable UI located in the scene, after empty player spawns in.
#if UNITY_2022_2_OR_NEWER
sceneReferencer = GameObject.FindAnyObjectByType<SceneReferencer>();
#else
// Deprecated in Unity 2023.1
sceneReferencer = GameObject.FindObjectOfType<SceneReferencer>();
#endif
sceneReferencer.GetComponent<Canvas>().enabled = true;
}
}
}