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.
24 lines
524 B
C#
24 lines
524 B
C#
3 weeks ago
|
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;
|
||
|
}
|
||
|
}
|
||
|
}
|