ImageTargetController Class¶
Description¶
MonoBehaviour which controls ImageTarget in the scene, providing a few extensions in the Unity environment. Use ImageTargetController.Target directly when necessary.
Enums¶
public enum ImageTargetController.DataSource |
Target data source type. |
Classes¶
public class ImageTargetController.ImageFileSourceData |
Image data for target creation. |
public class ImageTargetController.TargetDataFileSourceData |
Target data for target creation. Target scale and name are defined in the etd file. |
MonoBehaviour Messages¶
protected override void Start() |
protected virtual void Update() |
protected virtual void OnDestroy() |
Fields¶
SourceType¶
- C#
public ImageTargetController.DataSource SourceType
Target data source.
ImageFileSource¶
- C#
public ImageTargetController.ImageFileSourceData ImageFileSource
Image data source for target creation. Valid when ImageTargetController.SourceType == ImageTargetController.DataSource.ImageFile .
TargetDataFileSource¶
- C#
public ImageTargetController.TargetDataFileSourceData TargetDataFileSource
Target data source for target creation. Valid when ImageTargetController.SourceType == ImageTargetController.DataSource.TargetDataFile .
TargetSource¶
- C#
public ImageTarget TargetSource
Target source when using a target already created. Valid when ImageTargetController.SourceType == ImageTargetController.DataSource.Target .
ActiveControl¶
- C#
public TargetController.ActiveControlStrategy ActiveControl
Strategy to control the GameObject .active. If you are willing to control GameObject .active or there are other components controlling GameObject .active, make sure to set it to TargetController.ActiveControlStrategy.None .
Properties¶
Target¶
- C#
public ImageTarget Target { get; }
EasyAR Sense API. Accessible after TargetAvailable event.
Tracker¶
- C#
public ImageTrackerFrameFilter Tracker { get; set; }
The ImageTrackerFrameFilter which loads the target after ImageTargetController.TargetAvailable . When set to null, the target will be unloaded from tracker previously set. Modify at any time and takes effect immediately.
Size¶
- C#
public Vector2 Size { get; }
Physical size of ImageTarget in meter.
IsTracked¶
- C#
public bool IsTracked { get; }
Is the target being tracked at the moment.
IsLoaded¶
- C#
public bool IsLoaded { get; protected set; }
Is the target loaded by a tracker.
Events¶
TargetAvailable¶
- C#
public event Action TargetAvailable
Event when ImageTargetController.Target can be used.
TargetLoad¶
- C#
public event Action< Target , bool> TargetLoad
Target load finish event. The bool value indicates the load success or not.
TargetUnload¶
- C#
public event Action< Target , bool> TargetUnload
Target unload finish event. The bool value indicates the unload success or not.
TargetFound¶
- C#
public event Action TargetFound
Target found event.
TargetLost¶
- C#
public event Action TargetLost
Target lost event.