// * * * * * * * * * * * * *

    // Awake
    void Awake()
    {
        // Find camera controller
        OVRCameraController[] CameraControllers;
        CameraControllers = gameObject.GetComponentsInChildren <OVRCameraController>();

        if (CameraControllers.Length == 0)
        {
            Debug.LogWarning("OVRMainMenu: No OVRCameraController attached.");
        }
        else if (CameraControllers.Length > 1)
        {
            Debug.LogWarning("OVRMainMenu: More then 1 OVRCameraController attached.");
        }
        else
        {
            CameraController = CameraControllers[0];
        }

        // Find player controller
        OVRPlayerController_BB[] PlayerControllers;
        PlayerControllers = gameObject.GetComponentsInChildren <OVRPlayerController_BB>();

        if (PlayerControllers.Length == 0)
        {
            Debug.LogWarning("OVRMainMenu: No OVRPlayerController attached.");
        }
        else if (CameraControllers.Length > 1)
        {
            Debug.LogWarning("OVRMaunMenu: More then 1 OVRPlayerController attached.");
        }
        else
        {
            PlayerController = PlayerControllers[0];
        }
    }
 // OnEnable
 void OnEnable()
 {
     m_Component = (OVRPlayerController_BB)target;
 }
Example #3
0
 // OnEnable
 void OnEnable()
 {
     m_Component = (OVRPlayerController_BB)target;
 }
    // * * * * * * * * * * * * *
    // Awake
    void Awake()
    {
        // Find camera controller
        OVRCameraController[] CameraControllers;
        CameraControllers = gameObject.GetComponentsInChildren<OVRCameraController>();

        if(CameraControllers.Length == 0)
            Debug.LogWarning("OVRMainMenu: No OVRCameraController attached.");
        else if (CameraControllers.Length > 1)
            Debug.LogWarning("OVRMainMenu: More then 1 OVRCameraController attached.");
        else
            CameraController = CameraControllers[0];

        // Find player controller
        OVRPlayerController_BB[] PlayerControllers;
        PlayerControllers = gameObject.GetComponentsInChildren<OVRPlayerController_BB>();

        if(PlayerControllers.Length == 0)
            Debug.LogWarning("OVRMainMenu: No OVRPlayerController attached.");
        else if (CameraControllers.Length > 1)
            Debug.LogWarning("OVRMaunMenu: More then 1 OVRPlayerController attached.");
        else
            PlayerController = PlayerControllers[0];
    }