MaxstARSDK  3.5.0
AbstractTrackableBehaviour.cs
1 /*==============================================================================
2 Copyright 2017 Maxst, Inc. All Rights Reserved.
3 ==============================================================================*/
4 
5 using UnityEngine;
6 
7 namespace maxstAR
8 {
12  public enum StorageType
13  {
22  }
23 
28  public abstract class AbstractTrackableBehaviour : MonoBehaviour
29  {
30  [SerializeField]
31  private StorageType storageType = StorageType.StreamingAssets;
32 
33  [SerializeField]
34  private UnityEngine.Object trackerDataFileObject = null;
35 
36  [SerializeField]
37  private string trackerDataFileName = null;
38 
39  [SerializeField]
40  private string trackableId = null;
41 
42  [SerializeField]
43  private string trackableName = null;
44 
45  //[SerializeField]
46  //protected int trackableIndex = 0;
47 
52  {
53  get { return storageType; }
54  set { storageType = value; }
55  }
56 
61  {
62  get { return trackerDataFileObject; }
63  set
64  {
65  trackerDataFileObject = value;
66  }
67  }
68 
72  public string TrackerDataFileName
73  {
74  get { return trackerDataFileName; }
75  set
76  {
77  trackerDataFileName = value;
78  OnTrackerDataFileChanged(trackerDataFileName);
79  }
80  }
81 
85  public string TrackableId
86  {
87  get { return trackableId; }
88  set { trackableId = value; }
89  }
90 
94  public string TrackableName
95  {
96  get { return trackableName; }
97  set { trackableName = value; }
98  }
99 
100  //public int TrackableIndex
101  //{
102  // get { return trackableIndex; }
103  //}
104 
109  protected virtual void OnTrackerDataFileChanged(string trackerFileName)
110  {
111  }
112 
117  public virtual void OnTrackFail()
118  {
119  }
120 
128  public virtual void OnTrackSuccess(string id, string name, Matrix4x4 poseMatrix)
129  {
130  }
131  }
132 }
UnityEngine.Object TrackerDataFileObject
Save tracking file object name in StreamingAssets folder (For editor mode)
string TrackableName
Tracking file name only without extention.
virtual void OnTrackerDataFileChanged(string trackerFileName)
To notify tracker file changed (Editor mode only)
File is located in android assets folder
string TrackableId
Tracking file uuid. This value is addressed in tracking file.
virtual void OnTrackSuccess(string id, string name, Matrix4x4 poseMatrix)
Common interface to notify this target tracking success. Child class can override this method to rece...
Parent class of all TrackableBehaviour. Save tracking file's id (uuid), name, path etc...
virtual void OnTrackFail()
Common interface to notify this target lost tracking. Child class can override this method to receive...
StorageType
To check the special case of android file is in assets folder