Hello, i don't understand exactly what you mean, if you want to activate and attach a dataset on runtime to the AR cmera there's a method well documented on the Vuforia documentation, if you want instead activated the dataset from the visual interface of Unity and you want control the image target generated on runtime the method is different.
When a Dataset is initialized it creates automatically the instances of the targets inside the dataset, if you want to control them realtime you have to attach at the instances of the imagetarget a scrpt, usually i attach a script to the AR camera like this:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Xml;
using System;
public class TargetLister : MonoBehaviour {
public TextAsset textXML;
public string name;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update ()
{
StateManager sm = TrackerManager.Instance.GetStateManager();
IEnumerable<TrackableBehaviour> tbs = sm.GetActiveTrackableBehaviours();
foreach(TrackableBehaviour tb in tbs)
{
name = tb.TrackableName;
ImageTarget it = tb.Trackable as ImageTarget;
Vector2 size = it.GetSize ();
XmlDocument xml = new XmlDocument();
xml.LoadXml(textXML.text);
GameObject go = tb.gameObject;
if (go.GetComponent<FucineBehaviour>() == null) {
// Add a Trackable event handler to the Trackable.
// This Behaviour handles Trackable lost/found callbacks.
go.AddComponent<FucineBehaviour>();
go.active = true;
XmlNode nodo = xml.SelectSingleNode("//Target[@id=\"" + name + "\"]");
go.GetComponent<FucineBehaviour>().infos = nodo;
}
else {
// Debug.Log ("ATTIVO GO");
// go.active = true;
}
}
}
}
The important part is the UPDATE function, when a target is activated this script attach to it a new script called FucineBehaviour that actually is our version of the DefaultTrackableEventHandler, throught this script and the use of XML i can control realtime all the events that are connected to a specific instance of a target....
You can already find good examples and documentation on the Vuforia website..
Hope that i was helpfull....
i am a beginner
How can I start learning Unity fast?
pls send unity examples
https://www.youtube.com/watch?v=ocKhz6tj-Z0