public static async Task <AppDialog.AppDialogResult> ClearObjectsNeedsConfirmation(bool createRoom)
    {
        AppDialog.AppDialogResult result = AppDialog.AppDialogResult.Cancel;
        bool dialogComplete = false;

        ExecuteOnUnityThread.Enqueue(async() =>
        {
            if (createRoom)
            {
                result = await OnCreateRoomNeedsConfirmation?.Invoke();
            }
            else
            {
                result = await OnJoinRoomNeedsConfirmation?.Invoke();
            }

            dialogComplete = true;
        });

        while (!dialogComplete)
        {
            await Task.Delay(25);
        }

        return(result);
    }
Ejemplo n.º 2
0
 public void Awake()
 {
     if (instance != null)
     {
         Destroy(this);
     }
     else
     {
         instance = this;
     }
 }
 public void Awake()
 {
     if (instance != null)
     {
         Destroy(this);
     }
     else
     {
         instance = this;
         applicationTokenSource = new CancellationTokenSource();
     }
 }