示例#1
0
        protected virtual void Awake()
        {
            bodyPhysics      = (bodyPhysics != null ? bodyPhysics : GetComponentInChildren <VRTK_BodyPhysics>());
            teleporter       = (teleporter != null ? teleporter : GetComponentInChildren <VRTK_BasicTeleport>());
            headsetCollision = (headsetCollision != null ? headsetCollision : GetComponentInChildren <VRTK_HeadsetCollision>());
            positionRewind   = (positionRewind != null ? positionRewind : GetComponentInChildren <VRTK_PositionRewind>());

            VRTK_SDKManager.instance.AddBehaviourToToggleOnLoadedSetupChange(this);
        }
示例#2
0
        protected virtual void Awake()
        {
            bodyPhysics = (bodyPhysics != null ? bodyPhysics : FindObjectOfType <VRTK_BodyPhysics>());

            if (bodyPhysics == null)
            {
                VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_SCENE, "VRTK_PlayerClimb", "VRTK_BodyPhysics"));
            }

            teleporter       = (teleporter != null ? teleporter : FindObjectOfType <VRTK_BasicTeleport>());
            headsetCollision = (headsetCollision != null ? headsetCollision : FindObjectOfType <VRTK_HeadsetCollision>());
            positionRewind   = (positionRewind != null ? positionRewind : FindObjectOfType <VRTK_PositionRewind>());

            VRTK_SDKManager.instance.AddBehaviourToToggleOnLoadedSetupChange(this);
        }