We are happy to announce that we have released WordPress WebGL Plugin.
Now it is super simple to embed your Unity 5.6> WebGL content into any wordpress driven website.
-----> WordPress WebGL Pluigin <-----
Documentation
----------------------
With this package you get two WordPress plugins.
- Unity3D ( WebGL embedding )
- Unity3D Uploader ( Game manager and uploader )
WARRNING!!! This plugin is intended to be used with Unity 5.6> WebGL exports.
INSTALLATION
Simply go to your https://website.com/wp-admin/
Go to Plugins tab. Add new. Upload.( Upload both plugins and activate them )
ZIPPING YOUR GAME
Go to your Unity exported game directory and zip Build and TemplateData directories.
Give your zip name which is then used as a game name reference when you embed your content in wordpress.
UPLOADING
In your admin console go to Media->Games and drag your zip file onto the ‘Choosefile’ button and then press ‘UploadandExtract’
EMBEDDING
Use shortcodes in your posts or pages. Here is an example.
[unity3d_game src=“TEST” name=“WebGLTEST” fullscreen=1 autorun=0 logo=1 spinner=1]
Optional parameters containing predefined values as you see below.
[MUST]‘game’=>‘’- Is the name of your zip file. You can always check what games are unpacked on your server in Media–>Games->Available Games
[OPTIONAL]‘id’=> substr(md5(rand()),0,10)- You can specify your own player id if you want to manipulate instantiated player. You can access instantiated player via ‘unityLoader_’.id variable.
[OPTIONAL]‘name’=>‘’- Name that will appear above the player window.
[OPTIONAL]‘autorun’=>0- Should the player start automatically when page is loaded?(0=false,1=true)
[OPTIONAL]‘fullscreen’=>0- Should the fullscreen image appear above the player window?(0=false,1=true)
[OPTIONAL]‘logo’=>1- Should the logo be displayed. This logo is the logo of the app or your company logo above the loading bar.(0=false,1=true)
[OPTIONAL]‘spinner’=>1- Should the spinenr be displayed. This spinner appears under the loading bar.(0=false,1=true)
[OPTIONAL]‘background’=>0- Should the background be displayed. It is background of the whole player window.(0=false,1=true)
[OPTIONAL]‘background_color’=>‘black’- Color of the player window.
[OPTIONAL]‘ratio_width’=>16- x part of the player aspect ratio
[OPTIONAL]‘ratio_height’=>9- y part of the player aspect ratio
[OPTIONAL]‘border_style’=>‘3pxsolidblack’- You can specify border of the player.
TEMPLETES
We have implemented fallback template solution. Which means that you can specify template images and styles on two places.
- Game TemplateData directory.
- Global TemplateData directory.
So in many cases you want to have one global template for your website. For that you just go to Media->Games and upload TempateData.zip that you can find inthis package.
OR you want to have game specific template images and style and in that case just include TemplateData directory next to your Build and pack it together.
( You can also make like Unity Editor WebGL templates for that so that thie TemplateData directory is included automatically when you hit build )
In case Game or Global TemplateData are not defined the plugin always fall back to its own internall template data.
The player is responsive. Which means it will keep aspect ratio you specify in your shortcode.
That is all. Happy embedding.![]()
Marek Ledvina.