public void OnShareButtonClick()
 {
     NatShare.Share(texture,
                    () => {
         Debug.Log("sharing is complete.");
     });
 }
Ejemplo n.º 2
0
    IEnumerator TakeScreen()
    {
        yield return(new WaitForEndOfFrame());

        Texture2D screen = ScreenCapture.CaptureScreenshotAsTexture();

        NatShare.Share(screen);
    }
Ejemplo n.º 3
0
        public void OnButtonShareScreenshotClicked()
        {
            Debug.Log("OnButtonShareScreenshotClicked");

            if (screenshotTexture2D == null)
            {
                print("screenshot is null");
            }

            NatShare.Share(screenshotTexture2D);
        }
Ejemplo n.º 4
0
 public void shareSelf()
 {
     Debug.Log("DeEnqueued");
     //SocialShareSheet _shareSheet = new SocialShareSheet();
     //_shareSheet.Text = "We solved the mystery! #riddleMiaThis #mia";
     //_shareSheet.AttachImageAtPath(tempFile);
     //NPBinding.UI.SetPopoverPointAtLastTouchPosition(); // To show popover at last touch point on iOS. On Android, its ignored.
     //NPBinding.Sharing.ShowView(_shareSheet, FinishedSharing);
     //Texture2D myText = imageTexture.texture as Texture2D;
     NatShare.Share(myTexture, "We solved the mystery! #riddleMiaThis #mia");
 }
Ejemplo n.º 5
0
 // Invoked by NatCorder video recorder once video recording is complete
 private void OnRecording(string path)
 {
     Debug.Log("Recording saved to path: " + path);
     // Share
     if (shareRecordings)
     {
         NatShare.Share(path);
     }
     // Playback the recording
     else
     {
                     #if UNITY_EDITOR
         UnityEditor.EditorUtility.OpenWithDefaultApp(path);
                     #elif UNITY_IOS
         Handheld.PlayFullScreenMovie("file://" + path);
                     #elif UNITY_ANDROID
         Handheld.PlayFullScreenMovie(path);
                     #endif
     }
 }
Ejemplo n.º 6
0
        void OnReplay(string path)
        {
            if (!Replay.IsRecording)
            {
                duration = Time.time - videoStartTime;
                // Share the video

                if (duration > 3.0f)
                {
                    NatShare.Share(path);
                    Debug.Log("Saved recording to: " + path + " Time Length = " + duration);
                    ScreenBlocker.SetActive(false);
                }
                else
                {
                    Message.text = "Video too short! \r\n Tap and hold longer please.";
                    Debug.Log("Video too short =" + duration);
                }

                //Handheld.PlayFullScreenMovie("file://" + path);
                //NatShare.SaveToCameraRoll(path);
            }
        }
Ejemplo n.º 7
0
    public void ShareScreenshot()
    {
        //AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent");
        //AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent");

        //intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND"));
        //AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri");
        //AndroidJavaObject uriObject = uriClass.CallStatic<AndroidJavaObject>("parse", "file://" + snapShot);
        //intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_STREAM"), uriObject);
        //intentObject.Call<AndroidJavaObject>("setType", "image/png");

        //intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_TEXT"), ShareMessage);

        //AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        //AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity");

        //AndroidJavaObject jChooser = intentClass.CallStatic<AndroidJavaObject>("createChooser", intentObject, "Share Picture");
        //currentActivity.Call("startActivity", jChooser);

        Texture2D image = tex;

        NatShare.Share(image);
    }
 public void OnButtonShareScreenshotClicked()
 {
     NatShare.Share(screenshotTexture2D);
     Debug.Log("OnButtonShareScreenshotClicked");
 }
Ejemplo n.º 9
0
    public void Share(string videoPath)
    {
#if UNITY_IOS || UNITY_ANDROID
        NatShare.Share(videoPath);
#endif
    }
Ejemplo n.º 10
0
 public void NativeShare()
 {
     vid.Stop();
     cnvPreview.enabled = false;
     NatShare.Share(_path, OnShare);
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Raises the share button click event.
        /// </summary>
        public void OnShareButtonClick()
        {
            Debug.Log("OnShareButtonClick ()");

            NatShare.Share(texture);
        }
Ejemplo n.º 12
0
 public void ShareTrack()
 {
     NatShare.Share(Application.persistentDataPath + "/" + _game.Filename, OnShare);
 }