ObjectTargetController Class¶
Description¶
MonoBehaviour which controls ObjectTarget in the scene, providing a few extensions in the Unity environment. Use ObjectTargetController.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 ObjectTargetController.SourceData |
Data for target creation. |
public class ObjectTargetController.ObjFileSourceData |
Obj file data for target creation. |
public class ObjectTargetController.TargetSourceData |
ObjectTarget data for target creation. |
Properties¶
Target¶
- C#
public ObjectTarget Target { get; }
Target data. Only usable after successful ObjectTargetController.TargetDataLoad .
Source¶
- C#
public ObjectTargetController.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 ObjectTargetController.TargetDataLoad , destroy earlier may cause load fail.
Tracker¶
- C#
public ObjectTrackerFrameFilter Tracker { get; set; }
The ObjectTrackerFrameFilter 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.
BoundingBox¶
- C#
public List< Vector3 > BoundingBox { get; }
Bounding box of the target. Only usable after successful ObjectTargetController.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.