private SteamVR_LaserPointer pointer; //!< pointer to the laser pointer /*! * \brief initializes variables * \details This function initializes the pointers to the scene such as controllers, laser pointer, teleporter */ void Awake() { controller = GetComponent <SteamVR_TrackedObject>(); controllerInput = GetComponent <SteamVR_TrackedController>(); teleporter = GetComponent <SteamVR_Teleporter>(); pointer = GetComponent <SteamVR_LaserPointer>(); }
// Use this for initialization void Start() { teleporter = GetComponent <SteamVR_Teleporter>(); laser.active = false; laser.gameObject.SetActive(false); var trackedController = GetComponent <SteamVR_TrackedController>(); if (trackedController == null) { trackedController = gameObject.AddComponent <SteamVR_TrackedController>(); } trackedController.PadClicked += new ClickedEventHandler(DoPadClick); trackedController.PadUnclicked += new ClickedEventHandler(DoPadUnclick); }
void Start() { // grab a reference to the SteamVR teleporter Component if (theTeleporterComponent == null) { if (GetComponent <SteamVR_Teleporter>()) { theTeleporterComponent = GetComponent <SteamVR_Teleporter>(); } } // grab a reference to the eye raycaster to find out what we're looking at if (eyecaster == null) { if (GetComponent <VREyeRaycaster>()) { eyecaster = GetComponent <VREyeRaycaster>(); } } }