Ejemplo n.º 1
0
        /// <summary>
        /// Awake this instance.
        /// </summary>
        void Awake()
        {
            // Find camera controller
            OVRCameraRig[] cameraControllers;
            cameraControllers = gameObject.GetComponentsInChildren <OVRCameraRig>();

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

            // Find player controller
            OVRPlayerController[] playerControllers;
            playerControllers = gameObject.GetComponentsInChildren <OVRPlayerController>();

            if (playerControllers.Length == 0)
            {
                Debug.LogWarning("OVRMainMenu: No OVRPlayerController attached.");
            }
            else if (playerControllers.Length > 1)
            {
                Debug.LogWarning("OVRMainMenu: More then 1 OVRPlayerController attached.");
            }
            else
            {
                playerController = playerControllers[0];
            }
        }
        /// <summary>
        /// Awake this instance.
        /// </summary>
        void Awake()
        {
            // Find camera controller
            OVRCameraRig[] cameraControllers;
            cameraControllers = gameObject.GetComponentsInChildren<OVRCameraRig>();

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

            // Find player controller
            OVRPlayerController[] playerControllers;
            playerControllers = gameObject.GetComponentsInChildren<OVRPlayerController>();

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