ImageTargetController Class¶
Description¶
MonoBehaviour which controls ImageTarget in the scene, providing a few extensions in the Unity environment. Use ImageTargetController.Target directly when necessary.
Target data will be loaded separately. It will start after session start. The full data loading will happen only once in the life time, if the session stops before load finish, it will be restarted in the next session start.
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. |
public class ImageTargetController.Texture2DSourceData |
Texture2D data for target creation. |
MonoBehaviour Messages¶
protected override void Start() |
private void Update() |
private void OnDestroy() |
Fields¶
SourceType¶
- C#
public ImageTargetController.DataSource SourceType
Target data source. Set before MonoBehaviour .Start.
ImageFileSource¶
- C#
public ImageTargetController.ImageFileSourceData ImageFileSource
Image data source for target creation. Valid when ImageTargetController.SourceType == ImageTargetController.DataSource.ImageFile . Set before MonoBehaviour .Start.
TargetDataFileSource¶
- C#
public ImageTargetController.TargetDataFileSourceData TargetDataFileSource
Target data source for target creation. Valid when ImageTargetController.SourceType == ImageTargetController.DataSource.TargetDataFile . Set before MonoBehaviour .Start.
Texture2DSource¶
- C#
public ImageTargetController.Texture2DSourceData Texture2DSource
Texture2D data source for target creation. Valid when ImageTargetController.SourceType == ImageTargetController.DataSource.Texture2D . Set before MonoBehaviour .Start.
TargetSource¶
- C#
public ImageTarget TargetSource
Target source when using a target already created. Valid when ImageTargetController.SourceType == ImageTargetController.DataSource.Target . Set before MonoBehaviour .Start.
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. When set to null, the target will be unloaded from tracker previously set. Modify at any time, the load will happen only when the session is running.
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.
Events¶
TargetDataLoad¶
- C#
public event Action<bool> TargetDataLoad
Target data finish load (not load into a tracker).
TargetFound¶
- C#
public event Action TargetFound
Target Found event.
TargetLost¶
- C#
public event Action TargetLost
Target Lost event.