Script

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

using System.

Collections;

using System.Collections.Generic;

using UnityEngine;

using Vuforia;

public class activateChildObjects : MonoBehaviour {

public GameObject MyObjName;

//Get the original GUI item to disable on drag of the cloned item

public string pathToDeactivate;

void Update(){

if(DefaultTrackableEventHandler.lostFound == true){

foreach (Transform child in MyObjName.transform) {

child.gameObject.SetActive(true);

Debug.Log("GOT IT");

}else{

foreach (Transform child in MyObjName.transform) {

child.gameObject.SetActive(false);

Debug.Log("Lost");

//Remove original panel

GameObject.Find("UserDefinedTarget/"+pathToDeactivate).SetActive(false);

You might also like