IEnumerator startShare(string _strMessage, string _strImage) { //string filename = "screenshot.png"; string path = ""; switch (Application.platform) { case RuntimePlatform.IPhonePlayer: path = Application.persistentDataPath + "/" + _strImage; break; case RuntimePlatform.Android: path = Application.persistentDataPath + "/" + _strImage; break; default: path = Application.persistentDataPath + "/" + _strImage; break; } SocialConnector.Share( _strMessage, null, path ); m_bShareEnd = true; yield return(0); }
IEnumerator WaitSS() { // レイアウト設定のために1フレーム待つ yield return(new WaitForEndOfFrame()); Application.CaptureScreenshot("image.png"); // キャプチャを保存する処理として1フレーム待つ yield return(new WaitForEndOfFrame()); #if UNITY_ANDROID Debug.Log(Application.persistentDataPath); SocialConnector.Share( string.Format("Level{0}を{1}い〜くあるでクリア! {2}", m_iLevel, m_iScore, DefineProject.TWEET_MESSAGE_CLEAR) ); #elif UNITY_IPHONE //DefineProject.TWEET_MESSAGE_CLEAR, string strTest = string.Format("Level{0}を{1}い〜くあるでクリア! {2}", m_iLevel, m_iScore, DefineProject.TWEET_MESSAGE_CLEAR); SocialConnector.Share( strTest, "", Application.persistentDataPath + "/image.png" ); #endif }
// シェアボタンを押したら void onShareButtonDown() { if (shareable) { Debug.Log("share"); string message = string.Format("Pen's Adventureで{0}点とりました。", ObstacleController.score); SocialConnector.Share(message, "#PensAdventure @PenPenDream", imagePath); shareable = false; } }
// Token: 0x0600049F RID: 1183 RVA: 0x00021210 File Offset: 0x0001F610 public IEnumerator SendSocial(string socialText, string socialURL, Texture2D sendTex, UIMaster ui) { ui.freezeUI(true); yield return(this.SaveTmpImage(sendTex)); this.SaveTmpImage(sendTex); yield return(new WaitForSeconds(1f)); SocialConnector.Share(socialText, socialURL, this.imagePath); ui.freezeUI(false); yield break; }
public IEnumerator Share() { //スクリーンショットを撮影 Application.CaptureScreenshot("image.png"); yield return(new WaitForEndOfFrame()); if (Application.platform == RuntimePlatform.Android) { text = "テスト"; URL = "特になし!"; } else if (Application.platform == RuntimePlatform.IPhonePlayer) { text = "テスト"; URL = "特になし!"; } yield return(new WaitForSeconds(1)); SocialConnector.Share(text, URL, imagePath); }
void OnGUI() { if (GUILayout.Button("<size=30><b>Take</b></size>", GUILayout.Height(60))) { ScreenCapture.CaptureScreenshot("image.png"); } GUILayout.Space(60); ///================= /// Share ///================= if (GUILayout.Button("<size=30><b>Share</b></size>", GUILayout.Height(60))) { SocialConnector.Share("Social Connector", "https://github.com/anchan828/social-connector", null); } if (GUILayout.Button("<size=30><b>Share Image</b></size>", GUILayout.Height(60))) { SocialConnector.Share("Social Connector", "https://github.com/anchan828/social-connector", imagePath); } }
/// <summary> /// キャプチャーの画像が作成されるまでまつ /// </summary> /// <returns>The image write waiting.</returns> /// <param name="imgPath">Image path.</param> /// <param name="message">Message.</param> IEnumerator CaptureImageWriteWaiting() { // レイアウト設定のために1フレーム待つ yield return(new WaitForEndOfFrame()); //写真撮影 Application.CaptureScreenshot(SCREENSHOTS + "/" + fileName); do { //Debug.Log ("Temporary ScreenShot hav not been written yet. " + GetImgPath + fileName); //書込み処理のために1フレーム待つ yield return(new WaitForEndOfFrame()); } while (!System.IO.File.Exists(GetImgPath + fileName)); // キャプチャを保存する処理として1フレーム待つ yield return(new WaitForEndOfFrame()); SocialConnector.Share(MESSAGE, URL, GetImgPath + fileName); isShoot = false; yield break; }