/// <summary>
        /// CaptureScreenshot() runs async, so we check the screenshot path to see if there is a file there, once a file is found, then we share it
        /// </summary>
        /// <param name="screenshotPath">Path the screenshot was saved to</param>
        /// <param name="text">Text to share with the screenshot</param>
        private IEnumerator WaitForScreenshotToSaveThenShare(string screenshotPath, string text)
        {
            while (!File.Exists(screenshotPath))
            {
                yield return(new WaitForSecondsRealtime(0.05f));
            }

            OnFrameAfterScreenshot?.Invoke();

            UnityNativeSharingHelper.ShareScreenshotAndText(text, screenshotPath, false, "Select App To Share With");
        }
Пример #2
0
 /// <summary>
 /// Shares a string
 /// </summary>
 /// <param name="text">Text to share</param>
 public void ShareString(string text)
 {
     UnityNativeSharingHelper.ShareText(text);
 }