private void Awake() { // Required Component: VRTK_PlayerPresence playerPresence = GetComponent <VRTK_PlayerPresence>(); if (useGravity) { if (!playerPresence) { playerPresence = gameObject.AddComponent <VRTK_PlayerPresence>(); } playerPresence.SetFallingPhysicsOnlyParams(true); } headCamera = VRTK_DeviceFinder.HeadsetTransform(); headsetCollision = headCamera.GetComponent <VRTK_HeadsetCollision>(); if (headsetCollision == null) { headsetCollision = headCamera.gameObject.AddComponent <VRTK_HeadsetCollision>(); } headsetFade = headCamera.GetComponent <VRTK_HeadsetFade>(); if (headsetFade == null) { headsetFade = headCamera.gameObject.AddComponent <VRTK_HeadsetFade>(); } }
protected override void Awake() { base.Awake(); // Required Component: VRTK_PlayerPresence playerPresence = GetComponent <VRTK_PlayerPresence>(); if (useGravity) { if (!playerPresence) { playerPresence = gameObject.AddComponent <VRTK_PlayerPresence>(); } playerPresence.SetFallingPhysicsOnlyParams(true); } }