TrackerDeviceSetter.cs 494 B

123456789101112131415161718192021222324252627
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class TrackerDeviceSetter : MonoBehaviour {
  6. SteamVR_TrackedObject trackedObj;
  7. // Use this for initialization
  8. void Start () {
  9. trackedObj = GetComponent<SteamVR_TrackedObject>();
  10. }
  11. // Update is called once per frame
  12. void Update () {
  13. }
  14. public void SetTrackingDevice(Dropdown dropDown)
  15. {
  16. trackedObj.SetDeviceIndex(dropDown.value);
  17. }
  18. }