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

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

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

へろなかLT

いも

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