private IEnumerator UpdatePlayerCountDelayed() { // Wait until the end of frame (so that the event has been subscribed to) yield return(new WaitForEndOfFrame()); // Fire the event ClientNumbersUpdated?.Invoke(); }
// Ensures that as clients disconnect, the client numbers are updated. public override void OnServerDisconnect(NetworkConnection conn) { base.OnServerDisconnect(conn); ClientNumbersUpdated?.Invoke(); }