(旧)コダフォンの日記ブログ(移転しました)

FC2ブログに移転しました。ここいる?

Unity WebGLの警告を表示させない方法

http://tsubakit1.hateblo.jp/entry/2017/03/31/235900

モバイルはまだサポートしてない旨のダイアログを無視する

ので、取っ払います。

やり方は簡単、WebGL向けに出力したフォルダのBuildフォルダ以下にUnityLoader.jsなる物があります。

f:id:tsubaki_t1:20170331234629j:plain

これの

UnityLoader.SystemInfo.hasWebGL?UnityLoader.SystemInfo.mobile?e.popup("Please note that Unity WebGL is not currently supported on mobiles. Press OK if you wish to continue anyway.",[{text:"OK",callback:t}]):["Firefox","Chrome","Safari"].indexOf(UnityLoader.SystemInfo.browser)==-1?e.popup("Please note that your browser is not currently supported for this Unity WebGL content. Press OK if you wish to continue anyway.",[{text:"OK",callback:t}]):t():e.popup("Your browser does not support WebGL",[{text:"OK",callback:r}])

t();

に置換するだけです。要するにダイアログ出してる所を大雑把に消しました。

色々と問題はあるかもしれませんが、これでとりあえずダイアログは出ません。