Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Unity WebGLでSNS認証したいですよね

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Unity WebGLでSNS認証したいですよね

へろなかLT

Avatar for いも

いも

May 05, 2017
Tweet

More Decks by いも

Other Decks in Programming

Transcript

  1. &YUFSOBM&WBMܦ༝ͰऔΓ·͠ΐ͏ private void SendQueryParameter() { string script = "SendMessage('" +

    gameObject.name + "', 'SetupOAuthCode', window.location.search)"; if (Application.platform == RuntimePlatform.WebGLPlayer) { Application.ExternalEval(script); } } public void SetupOAuthCode(string url) { Regex regEx = new Regex(@"code=[a-z0-9]+"); var match = regEx.Match(url); if(match.Success) { var keyValue = match.Value.Split('='); loadOAuthCodeStream.OnNext(keyValue[1]); } }