示例#1
0
        public override bool Load(string path, VuforiaUnity.StorageType storageType)
        {
            if (this.mDataSetPtr == IntPtr.Zero)
            {
                Debug.LogError("Called Load without a data set object");
                return(false);
            }
            string storagePath = VuforiaRuntimeUtilities.GetStoragePath(path, storageType);

            if (VuforiaWrapper.Instance.DataSetExists(storagePath, (int)storageType) == 0)
            {
                return(false);
            }
            if (VuforiaWrapper.Instance.DataSetLoad(storagePath, (int)storageType, this.mDataSetPtr) == 0)
            {
                Debug.LogError("Did not load: " + storagePath);
                return(false);
            }
            this.mPath        = path;
            this.mStorageType = storageType;
            bool arg_85_0 = this.CreateImageTargets();
            bool flag     = this.CreateMultiTargets();
            bool flag2    = this.CreateCylinderTargets();
            bool flag3    = this.CreateVuMarkTemplates();

            if (!arg_85_0 && !flag && !flag2 && !flag3)
            {
                this.CreateObjectTargets();
            }
            ((StateManagerImpl)TrackerManager.Instance.GetStateManager()).AssociateTrackableBehavioursForDataSet(this);
            return(true);
        }
示例#2
0
        public static string GetStoragePath(string path, VuforiaUnity.StorageType storageType)
        {
            string result = path;

            if (storageType == VuforiaUnity.StorageType.STORAGE_APPRESOURCE)
            {
                if (VuforiaRuntimeUtilities.IsWSARuntime())
                {
                    result = "Data/StreamingAssets/" + path;
                }
                if (VuforiaRuntimeUtilities.IsPlayMode())
                {
                    result = "Assets/StreamingAssets/" + path;
                }
            }
            return(result);
        }
示例#3
0
    // Load and activate a data set at the given path.
    private bool LoadDataSet(string dataSetPath, VuforiaUnity.StorageType storageType)
    {
        // Request an ImageTracker instance from the TrackerManager.
        ObjectTracker objectTracker = TrackerManager.Instance.GetTracker <ObjectTracker>();

        objectTracker.Stop();
        IEnumerable <DataSet> dataSetList = objectTracker.GetActiveDataSets();

        foreach (DataSet set in dataSetList.ToList())
        {
            objectTracker.DeactivateDataSet(set);
        }

        // Check if the data set exists at the given path.
        if (!DataSet.Exists(dataSetPath, storageType))
        {
            Debug.LogError("Data set " + dataSetPath + " does not exist.");
            return(false);
        }

        // Create a new empty data set.
        DataSet dataSet = objectTracker.CreateDataSet();

        // Load the data set from the given path.
        if (!dataSet.Load(dataSetPath, storageType))
        {
            Debug.LogError("Failed to load data set " + dataSetPath + ".");
            return(false);
        }

        // (Optional) Activate the data set.
        objectTracker.ActivateDataSet(dataSet);
        objectTracker.Start();

        AttachContentToTrackables(dataSet);

        return(true);
    }
 public override bool LoadFilterListFile(string path, VuforiaUnity.StorageType storageType)
 {
     path = VuforiaRuntimeUtilities.GetStoragePath(path, storageType);
     return(VuforiaWrapper.Instance.WordListLoadFilterList(path, (int)storageType) == 1);
 }
 public override int AddWordsFromFile(string path, VuforiaUnity.StorageType storageType)
 {
     path = VuforiaRuntimeUtilities.GetStoragePath(path, storageType);
     return(VuforiaWrapper.Instance.WordListAddWordsFromFile(path, (int)storageType));
 }
示例#6
0
 public abstract bool LoadWordListFile(string relativePath, VuforiaUnity.StorageType storageType);
示例#7
0
 public abstract bool LoadFilterListFile(string path, VuforiaUnity.StorageType storageType);
示例#8
0
 public abstract int AddWordsFromFile(string path, VuforiaUnity.StorageType storageType);
示例#9
0
 internal static bool ExistsImpl(string path, VuforiaUnity.StorageType storageType)
 {
     path = VuforiaRuntimeUtilities.GetStoragePath(path, storageType);
     return(VuforiaWrapper.Instance.DataSetExists(path, (int)storageType) == 1);
 }
示例#10
0
 public abstract bool Load(string path, VuforiaUnity.StorageType storageType);
示例#11
0
 public static bool Exists(string path, VuforiaUnity.StorageType storageType)
 {
     return(DataSetImpl.ExistsImpl(path, storageType));
 }