In my project I'm trying to edit my multi targets XML file to move targets around in runtime. However, since the streamingassets path is read only i need to store the xml in the persistentDataPath and load the data set from there, but I'm having no luck with that at the moment. This is the code I use now:
public void LoadAndActivateDataset(string loadThisDataset, ObjectTracker objectTracker)
TrackerManager trackerManager = (TrackerManager)TrackerManager.Instance;
//Create a new dataset object.
DataSet dataset = objectTracker.CreateDataSet();
//Load and activate the dataset if it exists
if (DataSet.Exists(loadThisDataset, VuforiaUnity.StorageType.STORAGE_ABSOLUTE))
if (!dataset.Load(loadThisDataset, VuforiaUnity.StorageType.STORAGE_ABSOLUTE))
Debug.LogError("Fail to load");
// Note: ImageTracker cannot have more than 100 total targets activated
Debug.LogError("Failed to activate dataset");
loadThisDataset is the path to my xml file, i.e, Path.Combine(Application.persistentDataPath, "Warehouse.xml").
The message I get in the console from dataset.Load(loadThisDataset, VuforiaUnity.StorageType.STORAGE_ABSOLUTE) is:
Creating Multi Target with values:
And all that's happening is one game object being created with the Multi Target behaviour component but the Warehouse database is not found.
How am I doing this wrong, have I not understood how to work with datasets perhaps? I thought simply loading the xml would find my database and instantiate the multi target.
Any help would be greatly apprectiated!