public void OnHandleButtonClicked()
        {
            ToggleActive(true, false);
            ActivityData payload = ActivityData.Empty;

            try
            {
                if (!string.IsNullOrWhiteSpace(m_ParentHandle.target.payloadViewController.payload))
                {
                    payload = JsonUtility.FromJson <ActivityData>(m_ParentHandle.target.payloadViewController.payload);
                }
            }
            catch (ArgumentException)
            {
                // Invalid json
                Debug.LogWarning("Found invalid json.");
            }
            catch (Exception e)
            {
                Debug.LogException(e);
            }

            DialogComponent dialog = m_DialogFactory.Create(payload, OnActivityPayloadChanged);

            m_DialogService.SendRequest(DialogRequest.Create(dialog));
        }
        /// <summary>
        ///     Opens a new file dialog.
        /// </summary>
        /// <param name="fileSelected">Callback when file is selected.</param>
        /// <param name="targetPath">Target path at which to create the file.</param>
        /// <param name="fileType">Target filetype extension (*.ext).</param>
        /// <param name="dialogPriority">Dialog Priority. Higher values get displayed first.</param>
        /// <returns></returns>
        public NewFileDialogViewController Show(FileSelectedDelegate fileSelected, string targetPath, string fileType, DialogPriority dialogPriority = DialogPriority.High)
        {
            NewFileDialogViewController newFileDialog = m_Factory.Create(fileSelected, targetPath, fileType);
            DialogRequest request = DialogRequest.Create((DialogComponent)newFileDialog, dialogPriority);

            m_DialogService.SendRequest(request);
            return(newFileDialog);
        }
        /// <summary>
        ///     Opens a file selector dialog.
        /// </summary>
        /// <param name="fileSelected">Callback when file is selected.</param>
        /// <param name="filePaths">File directories to be searched</param>
        /// <param name="filters">Optional filters to be passed, e.g. extensions (*.ext)</param>
        /// <param name="dialogPriority">Dialog Priority. Higher values get displayed first.</param>
        /// <returns></returns>
        public FileSelectorViewController Show(FileSelectedDelegate fileSelected, IEnumerable <string> filePaths, IEnumerable <string> filters, DialogPriority dialogPriority = DialogPriority.High)
        {
            FileSelectorViewController fileSelector = m_Factory.Create(fileSelected, filePaths, filters);
            DialogRequest request = DialogRequest.Create((DialogComponent)fileSelector, dialogPriority);

            m_DialogService.SendRequest(request);
            return(fileSelector);
        }
Exemplo n.º 4
0
        /// <inheritdoc/>
        public IDialog DisplayMilestoneAchieved(MilestoneData milestoneData)
        {
            DialogComponent dialogComponent = m_PopupFactory.Create(milestoneData);
            DialogRequest   request         = DialogRequest.Create(dialogComponent, DialogPriority.Low);

            m_DialogService.SendRequest(request);
            return(dialogComponent);
        }