Skip to content

Instantly share code, notes, and snippets.

@aki017
Created June 29, 2017 19:13
Show Gist options
  • Save aki017/76f139f0a123325fd486defc23f4a233 to your computer and use it in GitHub Desktop.
Save aki017/76f139f0a123325fd486defc23f4a233 to your computer and use it in GitHub Desktop.
Tweet From UnityRoom
using UnityEngine;
namespace MyUnityLib
{
public static class TwitterUtils
{
public static void Tweet(string text)
{
Application.ExternalEval(
"window.addEventListener('mouseup', function (e) {"+
" window.removeEventListener(e.type, arguments.callee);"+
" window.open('https://twitter.com/intent/tweet?url='+document.referrer.replace('/webgl','')+'&text="+
WWW.EscapeURL(text) + "&via=uni_rm&related=uni_rm', '_blank')" +
"});");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment