Volodia Panak
Volodia Panak

Reputation: 1

javascript error airconsole generator and unity

Hi I am making a game on unity with airconsole and when I try to import the airconsole controls github repo to my unity project I get a lot of javascript errors, so I can't use the controller generator and it hinders me, A LOT.

Thanks in advance, you would save my skin.

Upvotes: 0

Views: 285

Answers (1)

Alice
Alice

Reputation: 335

Your HTML, CSS and JavaScript files, as well as all additional resources your controller will need (images etc.), need to be in Assets/WebGLTemplates/AirConsole so Unity will not try to compile them into C# or UnityScript.

Your controller HTML file itself can be somewhere else in the project, the file within Assets/WebGLTemplates/AirConsole will be updated automatically to match it as long as it is linked in the AirConsole Object in your scene.

If you add the plugin including example scenes into an empty project, you will see a working folder structure.

Edit/Update: in case you are getting errors along the lines of The type or namespace name 'ILGenerator' could not be found (or the same but with DynamicMethod) please see details on Reddit or StackOverflow. Essentially: you have to set API Compatibility level o 4.x in your Player Settings for your selected platform.

Upvotes: 1

Related Questions