This commit is contained in:
2026-02-11 20:50:03 +05:30
parent df77848ca5
commit 614c38bdaf
2303 changed files with 256620 additions and 4 deletions
@@ -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;
}
}
}