public void OnShareButtonClick() { NatShare.Share(texture, () => { Debug.Log("sharing is complete."); }); }
IEnumerator TakeScreen() { yield return(new WaitForEndOfFrame()); Texture2D screen = ScreenCapture.CaptureScreenshotAsTexture(); NatShare.Share(screen); }
public void OnButtonShareScreenshotClicked() { Debug.Log("OnButtonShareScreenshotClicked"); if (screenshotTexture2D == null) { print("screenshot is null"); } NatShare.Share(screenshotTexture2D); }
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"); }
// 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 } }
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); } }
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"); }
public void Share(string videoPath) { #if UNITY_IOS || UNITY_ANDROID NatShare.Share(videoPath); #endif }
public void NativeShare() { vid.Stop(); cnvPreview.enabled = false; NatShare.Share(_path, OnShare); }
/// <summary> /// Raises the share button click event. /// </summary> public void OnShareButtonClick() { Debug.Log("OnShareButtonClick ()"); NatShare.Share(texture); }
public void ShareTrack() { NatShare.Share(Application.persistentDataPath + "/" + _game.Filename, OnShare); }