Advertisement
echerkashin

Untitled

Mar 22nd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.30 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using EasyAR;
  5. public class EasyImageTargetBehaviour : ImageTargetBehaviour
  6. {
  7.  
  8.     public GameObject ScanCanvas;
  9.     public GameObject InfoCanvas;
  10.     protected override void Awake()
  11.     {
  12.         base.Awake();
  13.         TargetFound += OnTargetFound;
  14.         TargetLost += OnTargetLost;
  15.         TargetLoad += OnTargetLoad;
  16.         TargetUnload += OnTargetUnload;
  17.     }
  18.  
  19.     void OnTargetFound(TargetAbstractBehaviour behaviour)
  20.     {
  21.        // Debug.Log("Found: " + Target.Id);
  22.         ScanCanvas.SetActive(false);
  23.         InfoCanvas.SetActive(true);
  24.     }
  25.  
  26.     void OnTargetLost(TargetAbstractBehaviour behaviour)
  27.     {
  28.        // Debug.Log("Lost: " + Target.Id);
  29.         ScanCanvas.SetActive(true);
  30.         InfoCanvas.SetActive(false);
  31.     }
  32.  
  33.     void OnTargetLoad(ImageTargetBaseBehaviour behaviour, ImageTrackerBaseBehaviour tracker, bool status)
  34.     {
  35.       //  Debug.Log("Load target (" + status + "): " + Target.Id + " (" + Target.Name + ") " + " -> " + tracker);
  36.     }
  37.  
  38.     void OnTargetUnload(ImageTargetBaseBehaviour behaviour, ImageTrackerBaseBehaviour tracker, bool status)
  39.     {
  40.       //  Debug.Log("Unload target (" + status + "): " + Target.Id + " (" + Target.Name + ") " + " -> " + tracker);
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement