ImageTargetController Class¶
Description¶
MonoBehaviour which controls ImageTarget in the scene, providing a few extensions in the Unity environment. Use ImageTargetController.Target to access target data after load success.
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.
Classes¶
public abstract class ImageTargetController.SourceData |
Data for target creation. |
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. |
public class ImageTargetController.TargetSourceData |
ImageTarget data for target creation. |
Properties¶
Target¶
- C#
public ImageTarget Target { get; }
Target data. Only usable after successful ImageTargetController.TargetDataLoad .
Source¶
- C#
public ImageTargetController.SourceData Source { get; set; }
Data source for target creation. Only effective if modified before MonoBehaviour .Start.
If there are any referenced resources (like textures or Targets), they can be destroyed in ImageTargetController.TargetDataLoad , destroy earlier may cause load fail.
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 ImageTargetController.Target in meter. Only usable after successful ImageTargetController.TargetDataLoad .
ActiveController¶
- C#
public ActiveController ActiveController { get; }
GameObject .activeSelf controller.
Set MonoBehaviour .enabled to false to turn off control.
IsTracked¶
- C#
public bool IsTracked { get; }
Is target being tracked.
Events¶
TargetDataLoad¶
- C#
public event Action<bool> TargetDataLoad
Target data finish load (not load into a tracker).
TargetFound¶
- C#
public event Action TargetFound
Tracking target found event.
TargetLost¶
- C#
public event Action TargetLost
Tracking target lost event.