Ejemplo n.º 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>();
            }
        }
Ejemplo n.º 2
0
        protected virtual void OnEnable()
        {
            headsetFade      = GetComponent <VRTK_HeadsetFade>();
            headsetCollision = GetComponent <VRTK_HeadsetCollision>();

            headsetCollision.HeadsetCollisionDetect += new HeadsetCollisionEventHandler(OnHeadsetCollisionDetect);
            headsetCollision.HeadsetCollisionEnded  += new HeadsetCollisionEventHandler(OnHeadsetCollisionEnded);
        }
Ejemplo n.º 3
0
        protected virtual void OnEnable()
        {
            headsetFade      = (headsetFade != null ? headsetFade : GetComponentInChildren <VRTK_HeadsetFade>());
            headsetCollision = (headsetCollision != null ? headsetCollision : GetComponentInChildren <VRTK_HeadsetCollision>());

            headsetCollision.HeadsetCollisionDetect += new HeadsetCollisionEventHandler(OnHeadsetCollisionDetect);
            headsetCollision.HeadsetCollisionEnded  += new HeadsetCollisionEventHandler(OnHeadsetCollisionEnded);
        }
        private void OnEnable()
        {
            headsetFade = GetComponent<VRTK_HeadsetFade>();
            headsetCollision = GetComponent<VRTK_HeadsetCollision>();

            headsetCollision.HeadsetCollisionDetect += new HeadsetCollisionEventHandler(OnHeadsetCollisionDetect);
            headsetCollision.HeadsetCollisionEnded += new HeadsetCollisionEventHandler(OnHeadsetCollisionEnded);
        }
        private void OnEnable()
        {
            headsetCollision = gameObject.AddComponent <VRTK_HeadsetCollision>();
            headsetCollision.ignoreTargetWithTagOrClass = ignoreTargetWithTagOrClass;

            headsetFade = gameObject.AddComponent <VRTK_HeadsetFade>();

            headsetCollision.HeadsetCollisionDetect += new HeadsetCollisionEventHandler(OnHeadsetCollisionDetect);
            headsetCollision.HeadsetCollisionEnded  += new HeadsetCollisionEventHandler(OnHeadsetCollisionEnded);
        }
Ejemplo n.º 6
0
        public override void OnEnter()
        {
            var go = Fsm.GetOwnerDefaultTarget(gameObject);

            headset = go.GetComponent <VRTK.VRTK_HeadsetFade>();

            doFade();

            if (!everyFrame.Value)
            {
                Finish();
            }
        }
Ejemplo n.º 7
0
        protected virtual void OnEnable()
        {
            headsetFade      = (headsetFade != null ? headsetFade : FindObjectOfType <VRTK_HeadsetFade>());
            headsetCollision = (headsetCollision != null ? headsetCollision : FindObjectOfType <VRTK_HeadsetCollision>());

            if (headsetFade == null)
            {
                VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "VRTK_HeadsetCollisionFade", "VRTK_HeadsetFade", "the same or child"));
                return;
            }

            if (headsetCollision == null)
            {
                VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "VRTK_HeadsetCollisionFade", "VRTK_HeadsetCollision", "the same or child"));
                return;
            }

            headsetCollision.HeadsetCollisionDetect += new HeadsetCollisionEventHandler(OnHeadsetCollisionDetect);
            headsetCollision.HeadsetCollisionEnded  += new HeadsetCollisionEventHandler(OnHeadsetCollisionEnded);
        }
Ejemplo n.º 8
0
        private void Awake()
        {
            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>();
            }
        }