public static void TweetWithImage(string gameId, string text, params string[] hashTags) { if (_currentCoroutine != null) { Debug.Log("画像アップロード中に多重呼び出しされました。"); return; } var tweetData = new TweetData(gameId, text, hashTags); var title = tweetData.GameUrl; var desc = text; _currentCoroutine = CoroutineHandler.StartStaticCoroutine( GyazoUploader.CaptureScreenshotAndUpload( title , desc , (res, error) => { if (string.IsNullOrEmpty(error)) { Debug.Log("画像アップロード成功 : " + res.permalink_url); //エラーなし => ツイートする tweetData.ImageUrl = res.permalink_url; Tweet(tweetData); } else { //エラーあり Debug.LogError("画像アップロード失敗 : " + error); } _currentCoroutine = null; })); }
/// <summary> /// Upload the image to the specified host /// </summary> /// <param name="img"></param> public static void Upload(System.Drawing.Bitmap img) { switch (Config.conf.Uploader.ToLower()) { default: case "imgur": ImgurUploader.Upload(Image.bitmapToBase64(img)); break; case "vgyme": VgyMeUploader.Upload(img); break; case "gyazo": GyazoUploader.Upload(img); break; } }