Per Unity - Manual: Using WebGL templates (unity3d.com), I can create custom WebGL variables like Game_Title, as shown in the image below. I’m trying to figure out how to set variables via C#. I.e. I have a menu script that is updating scenes with details according to certain fields that change on occation. I want to update the test buttons in the template to call on the new information. Any Advice?
I don’t have an answer for you but in-case you don’t know, there’s a dedicated WebGL sub-forum here.
Thanks. I missed that. I don’t see a way to move my post. But I will if I can.
If if recall correctly then the template variables you are defining are for build time, not runtime. Imagine unity doing a string replace on the html text at build time. Once done, it’s gone.
If you want to change anything at runtime you will have to fiddle with JavaScript and the DOM of the website. Those defines you see there are not the solution to your problem.
Though I might be wrong. I haven’t made a webGL build in a long time.
1 Like
I can move it for you. There’ll be a redirect in this location too for a while to the new post.