1234567891011121314151617181920212223242526272829303132333435363738 |
- using NRKernal;
- using UnityEngine;
- public class TrackableFoundTest : MonoBehaviour
- {
-
- public TrackableObserver Observer;
-
- public GameObject Obj;
-
- void Start()
- {
- #if !UNITY_EDITOR
- Destroy(GameObject.Find("EmulatorRoom"));
- #endif
- Obj.SetActive(false);
- Observer.FoundEvent += Found;
- Observer.LostEvent += Lost;
- }
-
-
-
- private void Found(Vector3 pos, Quaternion qua)
- {
- Obj.transform.position = pos;
- Obj.transform.rotation = qua;
- Obj.SetActive(true);
- }
-
- private void Lost()
- {
- Obj.SetActive(false);
- }
- }
|