using NRKernal;
using UnityEngine;
/// A trackable found test.
public class TrackableFoundTest : MonoBehaviour
{
/// The observer.
public TrackableObserver Observer;
/// The object.
public GameObject Obj;
/// Starts this object.
void Start()
{
#if !UNITY_EDITOR
Destroy(GameObject.Find("EmulatorRoom"));
#endif
Obj.SetActive(false);
Observer.FoundEvent += Found;
Observer.LostEvent += Lost;
}
/// Founds.
/// The position.
/// The qua.
private void Found(Vector3 pos, Quaternion qua)
{
Obj.transform.position = pos;
Obj.transform.rotation = qua;
Obj.SetActive(true);
}
/// Losts this object.
private void Lost()
{
Obj.SetActive(false);
}
}