A crucial aspect of indie-game developing is simply getting noticed. To that end, I wanted to include buttons to post to facebook and Twitter for example, so if someone liked the game they could tell their friends about it.
I had no idea how to go about it, but I found a very helpful tutorial here: http://unity3dtrenches.blogspot.dk/2014/02/unity-3d-how-to-post-to-twitter-from.html
Essentially, when you click the twitter button when the game is over, it invokes a link with a String directly from unity; I create a string using Unity's ToString() function along with the points of the player, and simply use the following code:
function ShareToTwitter (textToDisplay : String)
{
Application.OpenURL(TWITTER_ADDRESS +
"?text=" + WWW.EscapeURL(textToDisplay) +
"&lang=" + WWW.EscapeURL(TWEET_LANGUAGE));
}
with ShareToTwitter being the message along with a link to our game studio facebook page (https://www.facebook.com/sundogstudios)
Ingen kommentarer:
Send en kommentar