Skip to content

Instantly share code, notes, and snippets.

@iwashihead
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iwashihead/af32a181e89765ddad95 to your computer and use it in GitHub Desktop.
Save iwashihead/af32a181e89765ddad95 to your computer and use it in GitHub Desktop.
social-coonectorを使ってTweetを投稿するサンプル[Unity]
public class Sample : Monobehabiour {
public void OnShare()
{
StartCoroutine(Share());
}
IEnumerator Share()
{
// スクリーンショットをとる
Application.CaptureScreenshot("image.png");
// スクリーンショットの撮影に1フレーム待機
yield return null;
// Twitter用テキスト
string body = "" + score + "回土管をくぐり抜けた!! ("+GameDefine.difficulty.ToString()+") "
+ GameDefine.TWITTER_HASH_TAG + " " + GameDefine.APP_URL;
// social-connectorから共有
SocialConnector.Share(body, GameDefine.APP_URL_ANDROID, imagePath);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment