private IEnumerator PostFBScreenshot() { yield return(new WaitForEndOfFrame()); // Create a texture the size of the screen, RGB24 format int width = Screen.width; int height = Screen.height; Texture2D tex = new Texture2D(width, height, TextureFormat.RGB24, false); // Read screen contents into the texture tex.ReadPixels(new Rect(0, 0, width, height), 0, 0); tex.Apply(); SPShareUtility.FacebookShare("This is my text to share", tex); Destroy(tex); }
private IEnumerator PostScreenshot() { yield return(new WaitForEndOfFrame()); // Create a texture the size of the screen, RGB24 format int width = Screen.width; int height = Screen.height; Texture2D tex = new Texture2D(width, height, TextureFormat.RGB24, false); // Read screen contents into the texture tex.ReadPixels(new Rect(0, 0, width, height), 0, 0); tex.Apply(); SPShareUtility.TwitterShare(text, tex); Destroy(tex); dispatch(BaseEvent.COMPLETE); }
private IEnumerator TwitterScreenshot() { yield return(new WaitForEndOfFrame()); // Create a texture the size of the screen, RGB24 format int width = Screen.width; int height = Screen.height; Texture2D tex = new Texture2D(width, height, TextureFormat.RGB24, false); // Read screen contents into the texture tex.ReadPixels(new Rect(0, 0, width, height), 0, 0); tex.Apply(); #if UNITY_IPHONE SPShareUtility.TwitterShare("I just scored " + GameManager.Instance.LatestScore + " in a game of " + gameHashtag + " on iOS. Can you beat it?", tex); #elif UNITY_ANDROID SPShareUtility.TwitterShare("I just scored " + GameManager.Instance.LatestScore + " in a game of " + gameHashtag + " on Android. Can you beat it?", tex); #endif Destroy(tex); }
private void PostMSG() { SPShareUtility.FacebookShare("This is my text to share"); }
private void PostImage() { SPShareUtility.FacebookShare("This is my text to share", ImageToShare); }
public void SendWhatsapp() { SPShareUtility.WhatsappShare("This is my text to share", imageForPosting); }
public void SendMail() { SPShareUtility.SendMail("My E-mail Subject", "This is my text to share", "[email protected], [email protected]", imageForPosting); }
public void NativeShareWithImage() { SPShareUtility.ShareMedia("Share Caption", "Share Message", imageForPosting); }
public void NativeShare() { SPShareUtility.ShareMedia("Share Caption", "Share Message"); }
private void PostImage() { SPShareUtility.TwitterShare("This is my text to share", ImageToShare); }
private void PostMSG() { SPShareUtility.TwitterShare("This is my text to share"); }