/// <summary>
 /// Raises the trigger up event and notify the tag
 /// </summary>
 public void OnTriggerUp()
 {
     VRTracker.Manager.VRT_Tag tag = trackers [index % trackers.Count].GetComponent <VRTracker.Manager.VRT_Tag> ();
     if (tag != null)
     {
         tag.OnTriggerUp();
     }
 }
 // Use this for initialization
 void Start()
 {
     trackers = new List <GameObject> ();
     if (VRT_Manager.Instance.spectator)
     {
         gameObject.SetActive(false);
     }
     if (enable)
     {
         if (vrtrackerManager == null)
         {
             VRTracker.Manager.VRT_Tag[] tags = FindObjectsOfType(typeof(VRTracker.Manager.VRT_Tag)) as VRTracker.Manager.VRT_Tag[];
             if (tags.Length > 0)
             {
                 vrtrackerManager = tags [0].transform.parent.gameObject;
                 vrtrackerManager.SetActive(true);
                 trackers.Add(vrtrackerManager);
             }
             VRTracker.Manager.VRT_Manager.Instance.tags.Clear();
             foreach (VRTracker.Manager.VRT_Tag tag in tags)
             {
                 tag.gameObject.AddComponent <VRT_TagSimulator> ();
                 VRT_TagSimulator sim = tag.gameObject.GetComponent <VRT_TagSimulator> ();
                 sim.tagType = tag.tagType;
                 tag.enabled = false;
                 trackers.Add(tag.gameObject);
             }
         }
         else
         {
             vrtrackerManager.SetActive(true);
             trackers.Add(vrtrackerManager);
             for (int i = 0; i < vrtrackerManager.transform.childCount; i++)
             {
                 if (vrtrackerManager.transform.GetChild(i).gameObject.GetComponent <VRTracker.Manager.VRT_Tag> ())
                 {
                     VRTracker.Manager.VRT_Tag tag = vrtrackerManager.transform.GetChild(i).gameObject.GetComponent <VRTracker.Manager.VRT_Tag> ();
                     vrtrackerManager.transform.GetChild(i).gameObject.AddComponent <VRT_TagSimulator> ();
                     VRT_TagSimulator sim = vrtrackerManager.transform.GetChild(i).gameObject.GetComponent <VRT_TagSimulator> ();
                     sim.tagType = tag.tagType;
                     tag.enabled = false;
                     trackers.Add(vrtrackerManager.transform.GetChild(i).gameObject);
                 }
             }
         }
     }
     else
     {
         gameObject.SetActive(false);
     }
 }
 // Use this for initialization
 public override void SetTag(VRT_Tag tag)
 {
     parentTag = tag;
 }
Пример #4
0
 // Use this for initialization
 public virtual void SetTag(VRT_Tag tag)
 {
     parentTag = tag;
 }