private void OnEnable()
 {
     playArea          = VRTK_DeviceFinder.PlayAreaTransform();
     vrtk_RoomExtender = FindObjectOfType <VRTK_RoomExtender>();
     if (playArea == null || vrtk_RoomExtender == null)
     {
         Debug.LogWarning("Could not find PlayArea or 'VRTK_RoomExtender'. Please check if they are attached to the CameraRig");
         return;
     }
 }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     if (GetComponent <VRTK_ControllerEvents>() == null)
     {
         Debug.LogError("VRTK_RoomExtender_ControllerExample is required to be attached to a SteamVR Controller that has the VRTK_ControllerEvents script attached to it");
         return;
     }
     if (FindObjectOfType <VRTK_RoomExtender>() == null)
     {
         Debug.LogError("VRTK_RoomExtender is required to be attached to the CameraRig that has the VRTK_RoomExtender script attached to it");
         return;
     }
     roomExtender = FindObjectOfType <VRTK_RoomExtender>();
     //Setup controller event listeners
     GetComponent <VRTK_ControllerEvents>().TouchpadPressed        += new ControllerInteractionEventHandler(DoTouchpadPressed);
     GetComponent <VRTK_ControllerEvents>().TouchpadReleased       += new ControllerInteractionEventHandler(DoTouchpadReleased);
     GetComponent <VRTK_ControllerEvents>().ApplicationMenuPressed += new ControllerInteractionEventHandler(DoApplicationMenuPressed);
 }
 // Use this for initialization
 private void Start()
 {
     if (GetComponent <VRTK_ControllerEvents>() == null)
     {
         VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "VRTK_RoomExtender_ControllerExample", "VRTK_ControllerEvents", "the Controller Alias"));
         return;
     }
     if (FindObjectOfType <VRTK_RoomExtender>() == null)
     {
         VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_SCENE, "VRTK_RoomExtender_ControllerExample", "VRTK_RoomExtender"));
         return;
     }
     roomExtender = FindObjectOfType <VRTK_RoomExtender>();
     //Setup controller event listeners
     GetComponent <VRTK_ControllerEvents>().TouchpadPressed  += new ControllerInteractionEventHandler(DoTouchpadPressed);
     GetComponent <VRTK_ControllerEvents>().TouchpadReleased += new ControllerInteractionEventHandler(DoTouchpadReleased);
     GetComponent <VRTK_ControllerEvents>().ButtonTwoPressed += new ControllerInteractionEventHandler(DoSwitchMovementFunction);
 }
 // Use this for initialization
 private void Start()
 {
     if (GetComponent<VRTK_ControllerEvents>() == null)
     {
         Debug.LogError("VRTK_RoomExtender_ControllerExample is required to be attached to a SteamVR Controller that has the VRTK_ControllerEvents script attached to it");
         return;
     }
     if (FindObjectOfType<VRTK_RoomExtender>() == null)
     {
         Debug.LogError("VRTK_RoomExtender is required to be attached to the CameraRig that has the VRTK_RoomExtender script attached to it");
         return;
     }
     roomExtender = FindObjectOfType<VRTK_RoomExtender>();
     //Setup controller event listeners
     GetComponent<VRTK_ControllerEvents>().TouchpadPressed += new ControllerInteractionEventHandler(DoTouchpadPressed);
     GetComponent<VRTK_ControllerEvents>().TouchpadReleased += new ControllerInteractionEventHandler(DoTouchpadReleased);
     GetComponent<VRTK_ControllerEvents>().ApplicationMenuPressed += new ControllerInteractionEventHandler(DoApplicationMenuPressed);
 }
 // Use this for initialization
 private void Start()
 {
     if (GetComponent <VRTK_ControllerEvents>() == null)
     {
         Debug.LogError("VRTK_RoomExtender_ControllerExample is required to be attached to a Controller that has the VRTK_ControllerEvents script attached to it");
         return;
     }
     if (FindObjectOfType <VRTK_RoomExtender>() == null)
     {
         Debug.LogError("VRTK_RoomExtender script is required.");
         return;
     }
     roomExtender = FindObjectOfType <VRTK_RoomExtender>();
     //Setup controller event listeners
     GetComponent <VRTK_ControllerEvents>().TouchpadPressed  += new ControllerInteractionEventHandler(DoTouchpadPressed);
     GetComponent <VRTK_ControllerEvents>().TouchpadReleased += new ControllerInteractionEventHandler(DoTouchpadReleased);
     GetComponent <VRTK_ControllerEvents>().AliasMenuOn      += new ControllerInteractionEventHandler(DoSwitchMovementFunction);
 }
    void OnEnable()
    {
        steamVR_PlayArea  = GameObject.FindObjectOfType <SteamVR_PlayArea>();
        vrtk_RoomExtender = GameObject.FindObjectOfType <VRTK_RoomExtender>();
        if (steamVR_PlayArea == null || vrtk_RoomExtender == null)
        {
            Debug.LogWarning("Could not find 'SteamVR_PlayArea' or 'VRTK_RoomExtender'. Please check if they are attached to the 'CameraRig'");
            return;
        }
        bool success = SteamVR_PlayArea.GetBounds(steamVR_PlayArea.size, ref steamVrBounds);

        if (success)
        {
            lastSize = steamVR_PlayArea.size;
            BuildMesh();
        }
        else
        {
            Debug.LogWarning("Could not get the Calibrated Play Area bounds. This script 'RoomExtender_PlayArea' tries to get the size when SteamVR is running.");
        }
    }
 void OnEnable()
 {
     steamVR_PlayArea = GameObject.FindObjectOfType<SteamVR_PlayArea>();
     vrtk_RoomExtender = GameObject.FindObjectOfType<VRTK_RoomExtender>();
     if (steamVR_PlayArea == null || vrtk_RoomExtender == null)
     {
         Debug.LogWarning("Could not find 'SteamVR_PlayArea' or 'VRTK_RoomExtender'. Please check if they are attached to the 'CameraRig'");
         return;
     }
     bool success = SteamVR_PlayArea.GetBounds(steamVR_PlayArea.size, ref steamVrBounds);
     if (success)
     {
         lastSize = steamVR_PlayArea.size;
         BuildMesh();
     }
     else
     {
         Debug.LogWarning("Could not get the Calibrated Play Area bounds. This script 'RoomExtender_PlayArea' tries to get the size when SteamVR is running.");
     }
 }