protected IEnumerator LaunchDialogOverTime(SimpleDialog.ButtonTypeEnum buttons, string title, string message)
        {
            // Disable all our buttons
            foreach (GameObject buttonGo in Interactibles)
            {
                buttonGo.SetActive(false);
            }
            Result.gameObject.SetActive(false);

            SimpleDialog dialog = SimpleDialog.Open(DialogPrefab, buttons, title, message);

            dialog.OnClosed += OnClosed;

            // Wait for dialog to close
            while (dialog.State != SimpleDialog.StateEnum.Closed)
            {
                yield return(null);
            }

            // Enable all our buttons
            foreach (GameObject buttonGo in Interactibles)
            {
                buttonGo.SetActive(true);
            }
            Result.gameObject.SetActive(true);
            launchedDialog = false;
            yield break;
        }
 protected void DisplayFinishScanningDialog()
 {
     ClearDialog();
     SimpleDialog.ButtonTypeEnum buttons = SimpleDialog.ButtonTypeEnum.Yes | SimpleDialog.ButtonTypeEnum.No;
     dialog           = SimpleDialog.Open(DialogPrefab, buttons, "Stop Updating Spatial Mapping", "Are you sure you want to stop updating spatial mapping?");
     dialog.OnClosed += OnFinishScanningDialogClosed;
 }
示例#3
0
        protected override void OnTapped(GameObject obj, InteractionManager.InteractionEventArgs eventArgs)
        {
            base.OnTapped(obj, eventArgs);
            if (launchedDialog)
            {
                return;
            }

            SimpleDialog.ButtonTypeEnum buttons = SimpleDialog.ButtonTypeEnum.Close;
            string title   = string.Empty;
            string message = string.Empty;

            switch (obj.name)
            {
            default:
                title   = Dialog1Title;
                message = Dialog1Message;
                buttons = Dialog1Button;
                break;

            case "SquareButtonDiag2":
                title   = Dialog2Title;
                message = Dialog2Message;
                buttons = Dialog2Button1 | Dialog2Button2;
                break;
            }

            launchedDialog = true;
            StartCoroutine(LaunchDialogOverTime(buttons, title, message));
        }
        protected IEnumerator DisplayScanningMessage()
        {
            yield return(new WaitForSeconds(1));

            ClearDialog();
            SimpleDialog.ButtonTypeEnum buttons = SimpleDialog.ButtonTypeEnum.OK;
            dialog           = SimpleDialog.Open(DialogPrefab, buttons, "Creating Spatial Mapping", "Look around your surroundings.\nTo stop spatial mapping, do AirTap.");
            dialog.OnClosed += OnScanningDialogClosed;
        }
        public IEnumerator StartMappingTexture()
        {
            if (State == AppStates.Scanning)
            {
                State = AppStates.MappingTexture;

                SpatialUnderstanding.Instance.RequestFinishScan();
                while (SpatialUnderstanding.Instance.ScanState != SpatialUnderstanding.ScanStates.Done)
                {
                    yield return(null);
                }

                TextureMappingManager.Instance.StartTextureMapping();
                MiniatureRoom.GenerateMesh();

                ClearDialog();
                SimpleDialog.ButtonTypeEnum buttons = SimpleDialog.ButtonTypeEnum.OK;
                dialog = SimpleDialog.Open(DialogPrefab, buttons, "Camera Mapping", "Move around and do AirTap.");
            }
        }