コード例 #1
0
        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>();
            }
        }
コード例 #2
0
        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);
            }
        }