Astra Unity 2.6.6
Astra Unity Plugin
|
This document has information about items that you will want to know in regards to making builds with Astra or using it in the Editor.
Astra needs to be initialized in order to perform queries, load assets, or run jobs. This boot process is handled through Astra.Configuration.Initialize (or it's related helper methods). This is an asynchronous request and as such it returns itself a job that you must wait upon before further action should take place. In addition to this there is an expected GameObject and Component that needs to be in your scene AstraManagerGO
and Astra.AstraManager. You can easily add this via the Astra/Pres Scene
menu option. Work that is requested will be added to a queue and will be run once initialized from the queue. It is important to remember that because of this behaviour you should always wait for Astra to be initialized before you perform work. This might mean that you poll Astra.AstraManager.IsReady or in a coroutine you call something like this:
We recommend you do this in a bootup sequence for your application or game before entering into the rest of your code to keep things simpler, otherwise you will have lots of checks to see if Astra is ready to run sprinkled throughout all your MonoBehaviours.
Failure to initialize Astra or have it in the scene may cause issues with running Astra especially failures of launch of builds vs using Astra in the Editor environment.
Note: Astra does not persist your configuration data for you, you must determine the best way to initialize the configuration system yourself for your builds.
In the Unity Editor, there are many helper ways of initializing Astra so that you can use it without having to write a piece of code that boots it up. This can be done by clicking on the Init
button on a JSON configuration file, for example. When triggering this in the Editor a component and GameObject will automatically be added to your scene as AstraManagerGO
with Astra.AstraManager behaviour attached. This does not automatically occur in a build, but will occur in Editor in play mode. This is so that you can control the boot sequence in your program.
Astra performs a few tricks to get avatars to be loaded in Edit mode in Unity. We strive to ensure a What You See Is What You Get, WYSIWYG, so that you can easily work, dress, edit your characters in realtime in your scene. Since Astra is a procedural and streaming solution assets there are some quirks that come with this.
There are no real differences between the Editor and Builds for Astra with the exception of configuration state persistance in the Editor. As stated before, you are responsible for booting and feeding Astra a configuration so it can start properly.
Astra currently requires an active network connection during initialization as it communicates back to servers. Work is being done to allow full offline support. Currently assets are installed into your local database and these will not be refetched unless updated on the server. This does allow you to pre-ship a database of assets if desired with your build.