=== HoweScape Unity3d WebGL === Contributors: pthowe Author URL: http://howescape.com Donate Link: http://HoweScape.com Tags: Unity3D Requires at least: 4.0.0 Tested up to: 5.7 Stable tag: 10.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Plugin to allow the inclusion of a Unity3d WebGL application. A short code is created which can displayed. == Description == The Unity3d WebGL support creates a directory of files. This is not convent to load on your WordPress web site. This plugin takes the "Release" directory from your game and places it inside the plugin. When compiling the output directory need to be "Builds_WebGL". This plugin can then be referenced from with a short code. The parameters in the short code are the game name and the width and height. ie. [hs_unity3d_web_gl_game src="Roll-A-Ball" height="500" width="600"] To extend the support for Unity3d to version 5.5.1 an additional parameter has been added. This parameter allows the specification of a version. The version support is 5.5.1 or the original version supported by the plugin. (ie. original version 5.3.1) The Unity3d version 5.5.1. creates a directory "Development". This is what I have uploaded in the included example. (ie. Roll-A-Ball-5_5_1-Release) The short code is now looks like the following example. ie. [hs_unity3d_web_gl_game src="Roll-A-Ball" height="500" width="600" u3dver="5.5.1"] In reviewing the latest verion of Unity3d I noticed that the file organization for the WebGL has been updated again. With this update there are now 6 supported version 5.3.1, 5.5.1, 5.6.0, 2017.4.0f1, 2018.4, 2019.4 and 2020.3. When using the newest version you would have a short code like the following. ie. [hs_unity3d_web_gl_game src="Roll-a-ball" height="500" width="600" u3dver="2019.4"] With the latest update to Wordpress 5.7 the format of the files has changed agaion. The WebGL build options include the choice of a "Development Build". While this options is not recommended for a published game, being able to use in the plugin would helpful. An additional parameter has been added to specify the build type. ie. [hs_unity3d_web_gl_game src="Roll-a-ball" height="900" width="900" u3dver="2020.3" buildtype="Development"] This feature has two supported values "Development" or "Production". This parameter is not necessary unless you have a development build. All other features should work as before. There are other features being considered please let me know if you desire anything functionality. With the addition of the settings page it is now possible to place the release directory in a zip file. (ie. <gamename>-Release.zip) Once the file is uploaded the setting page for the plugin will allow extraction of the files into a location which the short code can locate. When naming games from version 5.5.1 you will need to include the version number. (ie. <gamename>-5_5_1-Release.zip) With this version place the files from the Development directory in the zip file. For the latest verion it is the same. (ie. <gamename>-5_6_0-Release.zip) With the addition of the last 2 version the the version number is now shorter. In the process of doing the latest update I wanted to switch between the different games to verify that everything was working. To make this task simpler I added a short code which displays a list of the available games and allows the selection of a game. The major reason for the addition was game development. Since I thought it might be useful I have added it to the plugin. ie. [hs_unity3d_web_gl_gamepage] If you use this short code with just the plugin you will have three games. Four versions of the Roll-A-Ball sample game and the space-shooter sample game. There are 2 ways games can be added, one is making them part of the plugin. The second is as a zip file which gets uploaded to the media directory. Once uploaded the uploaded game zip file can be expanded into the plugin from the settings page. There is also a delete option on the settings page. It can remove any game from the plugin. The page now displays the short code with the parameters you selected. The goal of this display is to assist people in getting a short code which they can put on there page and display the game. As the results of a question which was asked, "How can I get information from the browser into the Unity Game?" I have added a short code which adds javascript variables to the page. The short code is: ie. [hs_unity3d_current_user] This addes the following to the HTML page: ie. It is then possible to add code to the Unity Game to extract this information and make it part of the unity game. The 2020 version of roll a ball game displays the user which is logged into the wordpress site. == Installation ==
Yes Take the release directory from Unity3d Build directory and place in the plugin directory. Prefix the release directory with the name of the game ending in "-Release" The game name then is used in the short code.
Yes. Each game is in its own <gamename>-Release directory
There are currently three games in the delivered plugin.
Yes, In the media directory
The settings page allows games to be extracted into the plugin.
The arrow keys allow movement of the ball to collect the cubes.
Arrow keys move ship.
Mouse button fires gun. Mouse needs to be in window.
"An error occured running the Unity content on this page."
"The error was: uncaught exception: incorrect header check"
When I compiled my Unity3d game I used "Builds_WebGL" as the directory. This seems to be a requirement of the plugin.With these versions the restriction on build directory has been removed. The names needs to not contain spaces.
The directory selected for the output.
For a game to be added you must add it to the plugin or create a zip file with the contents of the "build" directory.
No, I removed that feature, seemed to not fit.
The file name receives a dash and a number to represent the number of times uploaded. This information is now included in the list of uploaded files. The number is removed when the game is expaneded.
WebGL: Interacting with browser scripting
https://docs.unity3d.com/2020.2/Documentation/Manual/webgl-interactingwithbrowserscripting.html
This requires adding the directory "Plugins" in the "Assets" directory. The file added in the directory is <filename>.jslib. There is also the C-Sharpe file which calls the functions in the jslib file.
No, they are delivered expanded