示例#1
0
    private void Awake()
    {
        Cinema.GvrHead.trackPosition        = false;
        Camera.main.transform.localPosition = Vector3.zero;

        SceneModel sceneModel     = GlobalVariable.GetSceneModel();
        bool       isInteractable = (sceneModel != SceneModel.IMAXTheater && sceneModel != SceneModel.Drive);

        CinemaPanel.ChangeSceneStyle(isInteractable, false);
        switch (sceneModel)
        {
        case SceneModel.Drive:
            DriveModelQuadScreenTrans();
            break;

        default:
            PlayerGameobjectControl.Instance.QuadScreen.transform.localPosition = ImaxQuadScreenPosition;
            PlayerGameobjectControl.Instance.QuadScreen.transform.localScale    = ImaxQuadScreenScale;
            break;
        }

        PlayerGameobjectControl.Instance.HemisphereScreen.transform.localPosition = HemisphereScreenPosition;
        PlayerGameobjectControl.Instance.HemisphereScreen.transform.localScale    = HemisphereScale;
        PlayerGameobjectControl.Instance.SphereScreen.transform.localPosition     = OctahedronSphereScreenPosition;
        PlayerGameobjectControl.Instance.SphereScreen.transform.localScale        = OctahedronSphereScale;
        //if (GvrViewer.Controller.Eyes.Length == 2)
        //{
        //    foreach (var item in GvrViewer.Controller.Eyes)
        //    {
        //        item.cam.clearFlags = CameraClearFlags.Depth;
        //    }
        //}

        CameraMaskControl.GetInstance().HideMask();
    }
    private void SetBtnStatus()
    {
        SceneModel sceneModel = GlobalVariable.GetSceneModel();

        if (sceneModel == SceneModel.Default)
        {
            DefaultBtn.SetSelected(true);
            StarrySkyBtn.SetSelected(false);
            ImaxTheaterBtn.SetSelected(false);
            DriveBtn.SetSelected(false);
        }
        else if (sceneModel == SceneModel.StarringNight)
        {
            StarrySkyBtn.SetSelected(true);
            DefaultBtn.SetSelected(false);
            ImaxTheaterBtn.SetSelected(false);
            DriveBtn.SetSelected(false);
        }
        else if (sceneModel == SceneModel.IMAXTheater)
        {
            ImaxTheaterBtn.SetSelected(true);
            StarrySkyBtn.SetSelected(false);
            DefaultBtn.SetSelected(false);
            DriveBtn.SetSelected(false);
        }
        else if (sceneModel == SceneModel.Drive)
        {
            DriveBtn.SetSelected(true);
            ImaxTheaterBtn.SetSelected(false);
            StarrySkyBtn.SetSelected(false);
            DefaultBtn.SetSelected(false);
        }
    }
示例#3
0
    private void ChooseCinemaCnvasTrans()
    {
        if (CurJVideoInfo == null || (CurJVideoInfo.stereoType < 0 || CurJVideoInfo.stereoType > 8))
        {
            return;
        }
        if (CurJVideoInfo.stereoType == (int)StereoType.ST2D || CurJVideoInfo.stereoType == (int)StereoType.ST3D_LR || CurJVideoInfo.stereoType == (int)StereoType.ST3D_TB)
        {
            CinemaTipsCanvasControl.GetInstance().transform.parent = PlayerGameobjectControl.Instance.QuadScreen.transform;
            CinemaTipsCanvasControl.GetInstance().transform.localRotation = Quaternion.identity;

            if (GlobalVariable.GetSceneModel() == SceneModel.Default ||
                GlobalVariable.GetSceneModel() == SceneModel.StarringNight ||
                GlobalVariable.GetSceneModel() == SceneModel.IMAXTheater)
            {
                CinemaTipsCanvasControl.GetInstance().transform.localPosition = new Vector3(0, -0.07f, -17);
                CinemaTipsCanvasControl.GetInstance().transform.localScale = new Vector3(0.0003087959f, 0.0005483741f, 0.008f);
            }
            else if (GlobalVariable.GetSceneModel() == SceneModel.Drive)
            {
                DriveSceneModel driveModel = GlobalVariable.GetDriveSceneModel();
                switch (driveModel)
                {
                case DriveSceneModel.Karting:
                    CinemaTipsCanvasControl.GetInstance().transform.localPosition = new Vector3(-0.52f, -0.4f, -42);
                    CinemaTipsCanvasControl.GetInstance().transform.localScale = new Vector3(0.0002222223f, 0.0003960396f, 0.008f);
                    break;

                case DriveSceneModel.King:
                    CinemaTipsCanvasControl.GetInstance().transform.localPosition = new Vector3(0, -0.4f, -42);
                    CinemaTipsCanvasControl.GetInstance().transform.localScale = new Vector3(0.0001369315f, 0.0002769398f, 0.008f);
                    break;

                case DriveSceneModel.Rattletrap:
                    CinemaTipsCanvasControl.GetInstance().transform.localPosition = new Vector3(0.478f, -0.418f, -42);
                    CinemaTipsCanvasControl.GetInstance().transform.localScale = new Vector3(0.0003001876f, 0.0005333334f, 0.008f);
                    break;

                default:     //DriveSceneModel.Playboy
                    CinemaTipsCanvasControl.GetInstance().transform.localPosition = new Vector3(0, -0.4f, -42);
                    CinemaTipsCanvasControl.GetInstance().transform.localScale = new Vector3(0.0002191781f, 0.0003809524f, 0.008f);
                    break;
                }
            }
        }
        else
        {
            CinemaTipsCanvasControl.GetInstance().CinemaCanvasNormalTrans();
            CinemaCustomizeCanvasControl.GetInstance().SetDownloadSpeed("0 B/s");
        }
    }
示例#4
0
    /// <summary>
    /// 判断立体格式时,同时判断Setting UI上"屏幕尺寸"&"场景选择"按钮的可选性
    /// </summary>
    /// <param name="stereoType"></param>
    void VideoSettingsUIControl(StereoType stereoType)
    {
        if (stereoType == StereoType.ST2D || stereoType == StereoType.ST3D_LR || stereoType == StereoType.ST3D_TB)
        {
            if (GlobalVariable.GetSceneModel() == SceneModel.Default || GlobalVariable.GetSceneModel() == SceneModel.StarringNight)
            {
                VideoPlayerPanel.VideoCtrlPanel.SettingsPanel.ScreenSizeBtnStatusControl(true);
            }
            else if (GlobalVariable.GetSceneModel() == SceneModel.IMAXTheater || GlobalVariable.GetSceneModel() == SceneModel.Drive)
            {
                VideoPlayerPanel.VideoCtrlPanel.SettingsPanel.ScreenSizeBtnStatusControl(false);
            }

            VideoPlayerPanel.VideoCtrlPanel.SettingsPanel.SceneChangeBtnStatusControl(true);
        }
        else if (stereoType == StereoType.ST180_2D || stereoType == StereoType.ST180_LR || stereoType == StereoType.ST180_TB ||
                 stereoType == StereoType.ST360_2D || stereoType == StereoType.ST360_LR || stereoType == StereoType.ST360_TB)
        {
            VideoPlayerPanel.VideoCtrlPanel.SettingsPanel.ScreenSizeBtnStatusControl(false);
            VideoPlayerPanel.VideoCtrlPanel.SettingsPanel.SceneChangeBtnStatusControl(false);
        }
    }
示例#5
0
    private void Awake()
    {
        currentSceneModel = GlobalVariable.GetSceneModel();
        if (currentSceneModel == SceneModel.Default)
        {
            SetDefaultScene();
        }
        else if (currentSceneModel == SceneModel.IMAXTheater)
        {
            SetIMAXTheaterScene();
        }
        else if (currentSceneModel == SceneModel.StarringNight)
        {
            SetStarringNightScene();
        }
        else if (currentSceneModel == SceneModel.Drive)
        {
            DriveSceneModel driveModel = GlobalVariable.GetDriveSceneModel();
            switch (driveModel)
            {
            case DriveSceneModel.Karting:
                SetDrive_KartingScene();
                break;

            case DriveSceneModel.King:
                SetDrive_KingScene();
                break;

            case DriveSceneModel.Rattletrap:
                SetDrive_RattletrapScene();
                break;

            default:     //DriveSceneModel.Playboy
                SetDrive_PlayboyScene();
                break;
            }
        }
    }
示例#6
0
    /// <summary>
    /// Change player transform and scale
    /// </summary>
    public void ChangePlayerUI()
    {
        if (BendQuadScreen == null)
        {
            BendQuadScreen = PlayerGameobjectControl.Instance.QuadScreen;
        }
        SceneModel curSceneModel = GlobalVariable.GetSceneModel();

        if (curSceneModel == SceneModel.Default || curSceneModel == SceneModel.StarringNight)
        {
            ChangeScreenSize();
            //BendQuadScreen.transform.localPosition = new Vector3(0, -0.06f, 9.3f);
        }
        else if (curSceneModel == SceneModel.IMAXTheater)
        {
            BendQuadScreen.transform.localScale    = CinemaSettings.GetInstance().ImaxQuadScreenScale;
            BendQuadScreen.transform.localPosition = CinemaSettings.GetInstance().ImaxQuadScreenPosition;
        }
        else if (curSceneModel == SceneModel.Drive)
        {
            CinemaSettings.GetInstance().DriveModelQuadScreenTrans();
        }
    }
示例#7
0
    /// <summary>
    /// Set-up shader value for stereo mode
    /// </summary>
    public void SetPlayMode(/*bool isChangePlayMode, */ StereoType stereoType)
    {
        m_StereoType = stereoType;
        if (stereoType == StereoType.ST180_2D || stereoType == StereoType.ST180_LR || stereoType == StereoType.ST180_TB)
        {
            //Cinema.GvrHead.trackPosition = true;
            QuadScreen.gameObject.SetActive(false);
            HemisphereScreen.gameObject.SetActive(true);
            SphereScreen.gameObject.SetActive(false);

            VideoScreen = HemisphereScreen;
            //RenderSettings.skybox = null;
            Camera.main.clearFlags = CameraClearFlags.Nothing;
        }
        else if (stereoType == StereoType.ST360_2D || stereoType == StereoType.ST360_LR || stereoType == StereoType.ST360_TB)
        {
            //Cinema.GvrHead.trackPosition = false;
            QuadScreen.gameObject.SetActive(false);
            HemisphereScreen.gameObject.SetActive(false);
            SphereScreen.gameObject.SetActive(true);

            VideoScreen = SphereScreen;
            //RenderSettings.skybox = null;
            Camera.main.clearFlags = CameraClearFlags.Nothing;
        }
        else/* (stereoType == StereoType.ST2D || stereoType == StereoType.ST3D_LR || stereoType == StereoType.ST3D_TB)*/
        {
            SceneModel sceneModel     = GlobalVariable.GetSceneModel();
            bool       isInteractable = false;
            switch (sceneModel)
            {
            case SceneModel.Default:
            case SceneModel.StarringNight:
                isInteractable = true;
                break;
            }
            Camera.main.clearFlags = CameraClearFlags.Skybox;
            if (ChangeSceneStyleCallback != null)
            {
                ChangeSceneStyleCallback(isInteractable, true);
            }

            //Cinema.GvrHead.trackPosition = true;
            QuadScreen.gameObject.SetActive(true);
            HemisphereScreen.gameObject.SetActive(false);
            SphereScreen.gameObject.SetActive(false);

            VideoScreen = QuadScreen;
        }

        if (Gvr.Internal.BaseVRDevice.IsSupported && VideoScreen.sharedMaterial != VideoUnlitForMultiViewMaterial)
        {
            VideoScreen.sharedMaterial = VideoUnlitForMultiViewMaterial;
        }
        else if (!Gvr.Internal.BaseVRDevice.IsSupported && VideoScreen.sharedMaterial != VideoMaterial)
        {
            VideoScreen.sharedMaterial = VideoMaterial;
        }

        if (VideoScreen != null && VideoScreen.sharedMaterial != null && VideoScreen.sharedMaterial.mainTexture == null && MainTexture != null)
        {
            VideoScreen.sharedMaterial.mainTexture = MainTexture;
        }

        //ChangeSceneType(false);

        VideoScreen.sharedMaterial.SetFloat("_StereoMode", 0);
        VideoScreen.sharedMaterial.DisableKeyword("_STEREOMODE_LEFTRIGHT");
        VideoScreen.sharedMaterial.DisableKeyword("_STEREOMODE_TOPBOTTOM");

        int i = (int)stereoType % 3;

        if (i == 1)
        {
            VideoScreen.sharedMaterial.EnableKeyword("_STEREOMODE_LEFTRIGHT");
            VideoScreen.sharedMaterial.SetFloat("_StereoMode", 2);
        }
        else if (i == 2)
        {
            VideoScreen.sharedMaterial.EnableKeyword("_STEREOMODE_TOPBOTTOM");
            VideoScreen.sharedMaterial.SetFloat("_StereoMode", 1);
        }

        if (ScreenSizeBtnStatusControlCallback != null)
        {
            ScreenSizeBtnStatusControlCallback(m_StereoType);
        }
        TensileSetStretchingPicture(true);
    }