Unity Technologies has done it again. They have given us a new platform that has HTML5 with WebGL, Unity's new WebGL Platform. I wish I was familiar with the workings on Drupal but I guess I can learn. The goal is to develop a module that will allow the Unity WebGL (index page) be cut and pasted into Drupal Front Page as HTML content. I have decided to use the Module Development and Code Questions forum to start the work.

I am experimenting with the Unity WebGL platform with Drupal front page content. I want to relocate the content of the index file from the root directory by moving it to the Drupal's front page with full HTML functionality. In the root directory created from unity build, I see the Release directory reference in the index file but I do not see any reference to the Compressed directory. By moving the index.html file to a different location from the root directory and changing the Release reference but not sure about how to change possible Compressed directory references, has anyone setup a drupal page to show Unity WebGL content?

Moved the index.html file out from its root directory, the directory created by the Unity build. Changed the Release references in the index file to reflect the changes. Opened the index file at its new location in a browser (FireFox) and it worked. On the other hand, it failed in Drupal because it could not find a file indicated by the fileloader.js file.

There is a .htaccess file:

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP:Accept-encoding} gzip
RewriteRule (.*)Release(.*)\.js $1Compressed$2\.jsgz [L]
RewriteRule (.*)Release(.*)\.data $1Compressed$2\.datagz [L]
RewriteRule (.*)Release(.*)\.mem $1Compressed$2\.memgz [L]
RewriteRule (.*)Release(.*)\.unity3d $1Compressed$2\.unity3dgz [L]
AddEncoding gzip .jsgz
AddEncoding gzip .datagz
AddEncoding gzip .memgz
AddEncoding gzip .unity3dgz​

Regular Expressions are not my forte but it seems that it will NOT handle the following path/fileName such as > RootDirectororyName/Release/fileName.data <

Any advice where to start will be great. Thanks

Comments

DrupalMage’s picture

Quoted by: Unity Technologies

The Compressed files are not reference directly, but by telling the server to host those instead of the Release files. For apache, we emit a .htaccess file which takes care of that. So, you may have to edit that, or otherwise change your server setup accordingly.