Web component for Unity web player
Get Started
Install using bower
$ bower install unity-web-player
Usage
Start using Now
<unity-web-player source='gameFile.unity3d' name='My Game'></unity-web-player>
-
Flexible and Simple
Easy to insert a unity web player to your website through poylmer, without a messy code.
-
Play Button
Inserts a sweet play button and a background with a message to you attract the users.
-
Multiple Objects
Easy way to get multiple unity web player object on the same page.
Example
<unity-web-player source='PlanetEscapeFinal.unity3d' name='Planet Escape' autoplay="false" background="images/background.png" text="Ludum Dare 30 Game" color="white" playColor="green">
Code Sample
<!DOCTYPE html>
<html>
<head>
<title>My Game</title>
<script src="bower_components/webcomponentsjs/webcomponents.min.js"/></script>
<link rel="import" href="bower_components/unity-web-player/unity-web-player.html" />
</head>
<body>
<unity-web-player source="mygame.unity3d" width="980" height="465"></unity-web-player>
</body>
</html>
Options
Attribute | Type | Default | Description |
---|---|---|---|
source | String | *Required. Path to `.unity3d` file | |
name | String | The name of your game, will show on middle of the screen if `autoplay` is set to false | |
width | Integer | 980 | Sets the width of the unity web player |
height | Integer | 465 | Sets the height of the unity web player |
autoplay | Boolean | true | If false, will show a play button on middle of screen, otherwise will play game immediately. |
background | String | A path to a background image, will show if `autoplay` attribute is set to false | |
text | String | An aditional text to show when `autoplay` attribute is set to false | |
color | String | black | A color to `name` and `text` attribute |
playColor | String | black | The play button color. Current color availables: aqua, black, darkcyan, green, pink, red and white |