Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using EasyAR;
- public class EasyImageTargetBehaviour : ImageTargetBehaviour
- {
- public GameObject ScanCanvas;
- public GameObject InfoCanvas;
- protected override void Awake()
- {
- base.Awake();
- TargetFound += OnTargetFound;
- TargetLost += OnTargetLost;
- TargetLoad += OnTargetLoad;
- TargetUnload += OnTargetUnload;
- }
- void OnTargetFound(TargetAbstractBehaviour behaviour)
- {
- // Debug.Log("Found: " + Target.Id);
- ScanCanvas.SetActive(false);
- InfoCanvas.SetActive(true);
- }
- void OnTargetLost(TargetAbstractBehaviour behaviour)
- {
- // Debug.Log("Lost: " + Target.Id);
- ScanCanvas.SetActive(true);
- InfoCanvas.SetActive(false);
- }
- void OnTargetLoad(ImageTargetBaseBehaviour behaviour, ImageTrackerBaseBehaviour tracker, bool status)
- {
- // Debug.Log("Load target (" + status + "): " + Target.Id + " (" + Target.Name + ") " + " -> " + tracker);
- }
- void OnTargetUnload(ImageTargetBaseBehaviour behaviour, ImageTrackerBaseBehaviour tracker, bool status)
- {
- // Debug.Log("Unload target (" + status + "): " + Target.Id + " (" + Target.Name + ") " + " -> " + tracker);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement