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

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

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

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

へろなかLT

Avatar for いも

いも

May 05, 2017

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]); } }