DEV Community

KOGA Mitsuhiro
KOGA Mitsuhiro

Posted on • Originally published at qiita.com

UnityのWebGLビルドはWeb Server for Chromeで簡単に確認できるよ

はじめに

UnityでWebGLビルドした時にさくっとブラウザで確認したいものですがChromeはセキュリティの関係でローカルファイルを開いても動作しません。
以下の解説のように-allow-file-access-from-filesを起動時オプションに渡せば回避できますが常駐しているChromeを終了させなければならなかったりと面倒です。

そこでChromeから簡易Webサーバーを起動できるWeb Server for Chromeを使えばさくっと確認できるので紹介します。

使い方

  1. Chromeのブックマークバー左端のアプリからWeb Serverを開きます。

    image.png
    image.png

  2. 設定画面が開くのでCHOOSE FOLDERからWebGLビルドしたフォルダを選択します。

  3. Web Serverのスイッチをオンにしてサーバーを起動します。

  4. http://127.0.0.1:8887のリンクをクリックします。

    image.png

以上の手順でWebGLビルドしたページをChromeで確認できます😊

リンク

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay