IEnumerator Start() { vrRig.SetActive(!IsVRSimulated); vrSimulatorRig.SetActive(IsVRSimulated); yield return(null); bodyModel = GetComponentInChildren <VRBodyModel>(); VRInteraction.VRInput[] vrInputs = GetComponentsInChildren <VRInteraction.VRInput>(); for (int i = 0; i < 2; i++) { if (vrInputs[i].IsLeftHand) { leftController = vrInputs[i]; } else { rightController = vrInputs[i]; } } SetParent(aliasBody.transform, bodyModel.transform); SetParent(aliasHandR.transform, rightController.transform); SetParent(aliasHandL.transform, leftController.transform); aliasHandR.VRInput = rightController; aliasHandL.VRInput = leftController; yield return(null); IsReady = true; }
private static void SetupTeleporter(VRTeleporter teleporter, VRInteraction.VRInput controller) { teleporter.BodyModel = Body; teleporter.VRInput = controller; teleporter.VRInteractor = controller.VRInteractor; SetParent(teleporter.transform, teleporter.VRInteractor?.AttachTransform); }