protected SubTracker NewLighthouse(HumanoidControl humanoid, uint sensorId) { SubTracker subTracker = SteamVRSubTracker.Create(this); subTracker.subTrackerId = (int)sensorId; return(subTracker); }
public static SteamVRSubTracker Create(Tracker tracker) { Object lighthousePrefab = Resources.Load(resourceName); GameObject lighthouseObject = (lighthousePrefab == null) ? new GameObject(resourceName) : (GameObject)Instantiate(lighthousePrefab); lighthouseObject.name = "Lighthouse"; lighthouseObject.transform.parent = tracker.trackerTransform; lighthouseObject.SetActive(false); SteamVRSubTracker subTracker = lighthouseObject.AddComponent <SteamVRSubTracker>(); subTracker.tracker = tracker; return(subTracker); }