diff --git a/.vs/AR6June/v15/.suo b/.vs/AR6June/v15/.suo index 80e3300..c491d4f 100644 Binary files a/.vs/AR6June/v15/.suo and b/.vs/AR6June/v15/.suo differ diff --git a/Assets/Scenes/VuforiaVariantScene.unity b/Assets/Scenes/VuforiaVariantScene.unity index dfa5b38..5db5783 100644 Binary files a/Assets/Scenes/VuforiaVariantScene.unity and b/Assets/Scenes/VuforiaVariantScene.unity differ diff --git a/Assets/Scripts/ImageTargetDetector.cs b/Assets/Scripts/ImageTargetDetector.cs new file mode 100644 index 0000000..3d540e6 --- /dev/null +++ b/Assets/Scripts/ImageTargetDetector.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Vuforia; + +public class ImageTargetDetector : MonoBehaviour, + ITrackableEventHandler +{ + private TrackableBehaviour mTrackableBehaviour; + public Transform emptyTrans; + public GameObject currentsModels; + private GameObject target; + void Start() + { + mTrackableBehaviour = GetComponent(); + target = gameObject; + if (mTrackableBehaviour) + { + mTrackableBehaviour.RegisterTrackableEventHandler(this); + } + } + + public void OnTrackableStateChanged( + TrackableBehaviour.Status previousStatus, + TrackableBehaviour.Status newStatus) + { + if (newStatus == TrackableBehaviour.Status.DETECTED || + newStatus == TrackableBehaviour.Status.TRACKED || + newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED) + { + // Play audio when target is found + currentsModels.transform.SetParent(target.transform); + currentsModels.transform.localPosition = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/ImageTargetDetector.cs.meta b/Assets/Scripts/ImageTargetDetector.cs.meta new file mode 100644 index 0000000..fae1880 --- /dev/null +++ b/Assets/Scripts/ImageTargetDetector.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6bcbaa84afdf1e243824f01e70af1543 +timeCreated: 1500657321 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Switch.cs b/Assets/Switch.cs new file mode 100644 index 0000000..c4ddbbf --- /dev/null +++ b/Assets/Switch.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine.UI; +using UnityEngine; + +public class Switch : MonoBehaviour { + [SerializeField] private Button switchButton; + public bool isOn = false; + + public void switchTrigger () + { + if (!isOn) + { + isOn = true; + switchButton.transform.GetChild(0).gameObject.GetComponent().text = "OFF"; + } + else if (isOn) + { + isOn = false; + switchButton.transform.GetChild(0).gameObject.GetComponent().text = "ON"; + } + gameObject.SetActive(isOn); + } +} diff --git a/Assets/Switch.cs.meta b/Assets/Switch.cs.meta new file mode 100644 index 0000000..4be317d --- /dev/null +++ b/Assets/Switch.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: beb792e11e405184fb4929cd452613f3 +timeCreated: 1500655981 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: