How to Integrate Asset Layer into your Unity Game
Last updated
Last updated
Whether you have a working game and want to integrate Asset Layer, or you are starting from scratch, this video tutorial + written guide will walk you through all the essentials to integrate Asset Layer into your game and launch it for the world to play!
By following along with this 20 minute tutorial video using the example scene that comes with the Asset Layer Unity SDK, you will learn how to:
Create an Asset Layer app for your Unity project
Add the Asset Layer Unity SDK to your Unity project
Configure your Unity project with your Asset Layer credentials
Create slots to organize your app's assets
Turn your Unity assets into Asset Layer collections
Use the AssetLayerGameObject and Inventory manager to integrate assets into your scene
Utilize assets from third party games
Easily configure and deploy your game server
Authenticate users with our login scene
Build your game and publish to web using Unity WebGL
The first step for any Asset Layer project is to make sure you are signed up for Asset Layer and then to create an Asset Layer app for your project. If you aren't signed up, you can sign up for free (no credit card required) at assetlayer.com/dashboard
Once you are logged in, follow this guide to setup your app. If this is just a test app, you can name your app "Unity Test". Otherwise, provide the info that corresponds to your game's details.
Once you've created your app, you can follow this guide to add the Asset Layer Unity SDK to your Unity project and then configure your Unity Project using your Asset Layer app's credentials.
In order to start creating assets for your app, you'll need to create a slot. If you are following along with the tutorial video using the example scene, create a slot called "Balls" and add a Unity expression to your slot.
For more details on slots in general, check out Slots. Then, use the guide below to learn how to create your slot and add expressions.
Now that you have your slot, it's time to start creating collections of assets. You can do so directly from the Unity editor. If you are following along with the tutorial video, you can create collections using the Blue Ball, Red Ball, and Yellow Ball prefabs found in your [insert folder] folder.
To learn how to create assets directly from Unity, check out this guide.
[Need to update with packages + maybe new images]
Now that you have collections with assets in your app, it's time to integrate them into your scenes. The Asset Layer Unity SDK comes with two prefabs to make integrating your assets into your scene simple, the AssetLayerGameObject and the Inventory Manager.
If you are following along with the tutorial video, you'll want to grab the assetId of one of your newly minted assets using My Assets. You can then replace the ball in your scene with an AssetLayerGameObject and use the assetId to import that ball into your scene from Asset Layer. Then, add the Inventory Manager to your scene so you can select from any of your newly minted assets.
To learn how to use the AssetLayerGameObject and Inventory Manager, check out these guides.
[Finish inventory manager]
Now that you've integrated your own assets into your scene, you may want to spice things up by utilizing assets from another app as well. If you are following along with the video tutorial, then our game Rolltopia provides lovable, spherical characters designed to be used in games that have balls or other spheres as the player character.
You can follow the guide below to get permissions from Rolltopia and then add Rollies slot to your app. Then, you can add the Rollies slotId to your inventory manager and start playing with your Rollies! If you don't have any rollies, you can get them for free at rolltopia.games.
Asset Layer uses a server-side authentication mechanism to keep things as secure as possible. This may sound intimidating, but launching a server to do your Asset Layer authentication is extremely easy. We provide an open-source server you can easily deploy and configure for your app using a service like Heroku. To do so, simply follow the guide below.
Now that you have your game server set up, you can integrate our login scene in order to authenticate players and access their assets from your game build. The login scene works out of the box for PC, web, and mobile. Follow this guide on how to use the login scene in your game.
[Finish]
If you've been following along with this guide, you now have a game that is ready to build and publish. Congrats! The guide below will walk you through how to build your Unity game and publish to the web using the Asset Layer sample app. Using sample app, you can have a working website where players can play your game and view their assets without writing a single line of code!
Publishing to mobile or to a marketplace like Steam will require some additional steps. We are working on tools and guides to make this easier for you soon.
[Need guide]