运行 虚拟控制器时 Unity 文件 404 错误
Unity file 404 errors when running virtual controllers
我目前在 Unity 的资产文件夹中有以下文件结构。
├───AirConsole
│ ├───examples
│ │ ├───basic
│ │ │ └───Materials
│ │ └───pong
│ │ ├───materials
│ │ ├───scripts
│ │ └───sprites
│ ├───extras
│ ├───plugins
│ │ ├───Android
│ │ ├───iOS
│ │ ├───Newtonsoft.Json
│ │ │ ├───Bson
│ │ │ ├───Converters
│ │ │ ├───Linq
│ │ │ ├───Schema
│ │ │ ├───Serialization
│ │ │ └───Utilities
│ │ └───x86_64
│ │ └───WebView.bundle
│ │ └───Contents
│ │ ├───MacOS
│ │ └───Resources
│ ├───resources
│ └───scripts
│ └───editor
└───WebPlayerTemplates
|---controller.html
├───airconsole-controls
│ ├───button
│ ├───ctrl-generator
│ ├───dpad
│ ├───examples
│ ├───joystick
│ ├───rate-limiter
│ ├───shake-detecor
│ ├───swipe-analog
│ ├───swipe-digital
│ └───swipe-pattern
├───controller
│ ├───js
│ ├───libs
│ ├───styles
│ └───templates
└───__MACOSX
└───controller
├───js
├───libs
├───styles
└───templates
当我启动 unity 项目时,我收到以下请求的 404 错误。
GET http://192.168.56.1:7842/airconsole-controls/button/button.css
controller.html:10 GET http://192.168.56.1:7842/airconsole-controls/dpad/dpad.css
controller.html:12 GET http://192.168.56.1:7842/controller/styles/styles.css
controller.html:13 GET http://192.168.56.1:7842/controller/styles/controls.css
controller.html:56 GET http://192.168.56.1:7842/controller/libs/handlebars-v4.0.5.js
controller.html:59 GET http://192.168.56.1:7842/controller/libs/airconsole_view_manager.js
controller.html:62 GET http://192.168.56.1:7842/airconsole-controls/dpad/dpad.js
controller.html:66 GET http://192.168.56.1:7842/controller/js/controller_generator.js
controller.html:61 GET http://192.168.56.1:7842/airconsole-controls/button/button.js
controller.html:64 GET http://192.168.56.1:7842/airconsole-controls/swipe-digital/swipe-digital.js
controller.html:63 GET http://192.168.56.1:7842/airconsole-controls/swipe-analog/swipe-analog.js
controller.html:67 GET http://192.168.56.1:7842/controller/js/main.js
我是否误解了我应该如何构建我的项目以便 airconsole 可以找到正确的文件?还是我缺少项目。我的版本是 1.6。 controller.html 文件也位于 WebPlayerTemplates 中。我在那个文件夹中有所有 airconsole 客户端的东西,因为如果我不这样做,我会因为语法而得到大约 100 个编译错误。
据我所知,您的 controller.html 使用的文件必须位于以下文件夹中:Assets/WebGLTemplates/AirConsole
Unity 指南是 start
的好地方
或者您可以从 asset store 下载免费项目并试用它。
还有一点让我们感到困惑:不要将您要使用的自定义 controller.html 文件放在 Assets/WebGLTemplates/AirConsole 中,此 controller.html 会被 Airconsole 对象覆盖。而是将 controller.html 文件放在其他地方并将其拖到 Airconsole 对象的检查器中的 "Controller Html" 属性。
我目前在 Unity 的资产文件夹中有以下文件结构。
├───AirConsole
│ ├───examples
│ │ ├───basic
│ │ │ └───Materials
│ │ └───pong
│ │ ├───materials
│ │ ├───scripts
│ │ └───sprites
│ ├───extras
│ ├───plugins
│ │ ├───Android
│ │ ├───iOS
│ │ ├───Newtonsoft.Json
│ │ │ ├───Bson
│ │ │ ├───Converters
│ │ │ ├───Linq
│ │ │ ├───Schema
│ │ │ ├───Serialization
│ │ │ └───Utilities
│ │ └───x86_64
│ │ └───WebView.bundle
│ │ └───Contents
│ │ ├───MacOS
│ │ └───Resources
│ ├───resources
│ └───scripts
│ └───editor
└───WebPlayerTemplates
|---controller.html
├───airconsole-controls
│ ├───button
│ ├───ctrl-generator
│ ├───dpad
│ ├───examples
│ ├───joystick
│ ├───rate-limiter
│ ├───shake-detecor
│ ├───swipe-analog
│ ├───swipe-digital
│ └───swipe-pattern
├───controller
│ ├───js
│ ├───libs
│ ├───styles
│ └───templates
└───__MACOSX
└───controller
├───js
├───libs
├───styles
└───templates
当我启动 unity 项目时,我收到以下请求的 404 错误。
GET http://192.168.56.1:7842/airconsole-controls/button/button.css
controller.html:10 GET http://192.168.56.1:7842/airconsole-controls/dpad/dpad.css
controller.html:12 GET http://192.168.56.1:7842/controller/styles/styles.css
controller.html:13 GET http://192.168.56.1:7842/controller/styles/controls.css
controller.html:56 GET http://192.168.56.1:7842/controller/libs/handlebars-v4.0.5.js
controller.html:59 GET http://192.168.56.1:7842/controller/libs/airconsole_view_manager.js
controller.html:62 GET http://192.168.56.1:7842/airconsole-controls/dpad/dpad.js
controller.html:66 GET http://192.168.56.1:7842/controller/js/controller_generator.js
controller.html:61 GET http://192.168.56.1:7842/airconsole-controls/button/button.js
controller.html:64 GET http://192.168.56.1:7842/airconsole-controls/swipe-digital/swipe-digital.js
controller.html:63 GET http://192.168.56.1:7842/airconsole-controls/swipe-analog/swipe-analog.js
controller.html:67 GET http://192.168.56.1:7842/controller/js/main.js
我是否误解了我应该如何构建我的项目以便 airconsole 可以找到正确的文件?还是我缺少项目。我的版本是 1.6。 controller.html 文件也位于 WebPlayerTemplates 中。我在那个文件夹中有所有 airconsole 客户端的东西,因为如果我不这样做,我会因为语法而得到大约 100 个编译错误。
据我所知,您的 controller.html 使用的文件必须位于以下文件夹中:Assets/WebGLTemplates/AirConsole
Unity 指南是 start
的好地方或者您可以从 asset store 下载免费项目并试用它。
还有一点让我们感到困惑:不要将您要使用的自定义 controller.html 文件放在 Assets/WebGLTemplates/AirConsole 中,此 controller.html 会被 Airconsole 对象覆盖。而是将 controller.html 文件放在其他地方并将其拖到 Airconsole 对象的检查器中的 "Controller Html" 属性。