You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HighGroundRoyaleNetcode/Packages/com.unity.multiplayer.sampl.../Utilities/Net/WaitForNetworkManagerEvents.cs

24 lines
524 B
C#

using Unity.Netcode;
using UnityEngine;
namespace BossRoom.Scripts.Shared.Utilities
{
public class WaitForServerStarted : CustomYieldInstruction
{
bool m_IsDone;
public override bool keepWaiting => m_IsDone;
public WaitForServerStarted()
{
void SetDone()
{
NetworkManager.Singleton.OnServerStarted -= SetDone;
m_IsDone = true;
}
NetworkManager.Singleton.OnServerStarted += SetDone;
}
}
}