![]() This Drawable prefab will be instantiated at runtime at the appropriate location when an associated target is recognized, and will be destroyed when its target is lost. A trackable defines which targets from your collection you want to be tracked and what prefab should be instantiated as an augmentation. # Define custom augmentationsĬustom augmentations are defined by assigning a Prefab with the desired content to the Drawable field in the ImageTrackable inspector. This ensures that the parameters are passed correctly from the Wikitude plugin and are not overwritten by Unity.įor more information on working with Unity Events, please check the Unity Manual and Events Tutorial. When subscribing to events that have a single basic parameter type, make sure to select your function from the top list marked with Dynamic, rather than the static version from the bottom. On the desired event, click the plus sign to add a new subscriber, drag the GameObject that should receive the event over the None (Object) field and select the function you want to be called from the No Function dropdown. The second group includes events triggered by the ImageTracker itself if it was successfully initialized with the desired collection file or not. The first group contains events triggered by the TargetCollectionResource when the collection file was loaded or if there was an error. To react on events like successfully loading a collection file, you can use the Unity Events listed in in the inspector of the ImageTracker. Please make sure that the Target Source is set to Target Collection Resource and using the dropdown next to Target Collection you can choose the desired one. zip file should be used, select the ImageTracker game object in the scene. zip file into the special StreamingAssets folder, so that the Wikitude SDK can load them at runtime. You can also generate them right inside Unity with the Target Collection Editor. ![]() Target collections can be generated and downloaded from the Wikitude Studio - a free web-based tool, that you can access with your developer account. zip file) which contains information needed to detect those reference images. To add an image tracker to the scene, simply create a new GameObject and add the ImageTracker script to it.Īn ImageTracker itself needs a Wikitude Target Collection (.wtc or. You can either buy a commercial license from our webpage or download a free trial license key and play around with our SDK in Unity. It additionally needs to be configured with the correct license key for your application. The WikitudeSDK script handles the initialization and destruction of the SDK and its native components. The Wikitude Unity SDK is based on a couple of important scripts, two of which are the WikitudeSDK and the ImageTracker scripts. Make sure to read the chapter on how to create Image Targets before using Image Recognition on your own. ImageTrackable: The trackable configures which targets from the collection should be recognized and manages the lifetime and position of Drawablesĭrawable: An instance of an augmentation prefab that is instantiated in the scene when a target is detected. Multiple trackers can be created, however only one tracker can be active for tracking at any given time. ImageTracker: The tracker analyzes the live camera image and detects the targets stored in its associated target collection.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |