Created
June 29, 2017 19:13
-
-
Save aki017/76f139f0a123325fd486defc23f4a233 to your computer and use it in GitHub Desktop.
Tweet From UnityRoom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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