Exemplo n.º 1
0
    public void ActivateCamera(CAMERA_TYPE camType, bool force)
    {
        if (!force && selectedCamera == camType)
        {
            return;                                              // Already active
        }
        DisableCamera(selectedCamera);
        switch (camType)
        {
        case CAMERA_TYPE.CAMERA_ORBIT:
            selectedCamera   = CAMERA_TYPE.CAMERA_ORBIT;
            camOrbit.enabled = true;
            camOrbit.Activate();
            currentCamera = camOrbit;
            break;

        case CAMERA_TYPE.CAMERA_FPS:
            selectedCamera = CAMERA_TYPE.CAMERA_FPS;
            camFPS.enabled = true;
            camFPS.Activate();
            currentCamera = camFPS;
            break;

        case CAMERA_TYPE.CAMERA_OVR:
            DefaultCamera.SetActive(false);
            //camFPS.enabled = true;
            //camFPS.Activate();
            selectedCamera = CAMERA_TYPE.CAMERA_OVR;
            OVR_Controller.SetActive(true);
            //currentCamera = camFPS;
            break;
        }
    }
Exemplo n.º 2
0
    public override void Init()
    {
        gameObject.GetComponent <CharacterController>().enabled = true;
        camOrbit = gameObject.GetComponent <CameraOrbit>() as CameraOrbit;
        camFPS   = gameObject.GetComponent <CameraFPS>();
        OVR_Controller.SetActive(false);
        DefaultCamera.SetActive(true);

        DisableCamera(CAMERA_TYPE.CAMERA_ORBIT);
        DisableCamera(CAMERA_TYPE.CAMERA_FPS);
        currentCamera = camOrbit;
        ActivateCamera(selectedCamera, true);

        if (ROCHEScript.instance.buildType == ROCHEScript.BuildType.OVR)
        {
            ActivateCamera(CAMERA_TYPE.CAMERA_OVR, true);
        }
    }