示例#1
0
    public void clickStart()
    {
        if (camType == 0)
        {
            NatCam.SetActiveCamera(DeviceCamera.FrontCamera);
        }
        else if (camType == 1)
        {
            NatCam.SetActiveCamera(DeviceCamera.RearCamera);
        }

        if (resolType == 0)
        {
            NatCam.SetResolution(ResolutionPreset.Default);
        }
        else if (resolType == 1)
        {
            NatCam.SetResolution(ResolutionPreset.MediumResolution);
        }
        else if (resolType == 2)
        {
            NatCam.SetResolution(ResolutionPreset.LowestResolution);
        }

        if (focusType == 0)
        {
            NatCam.FocusMode = FocusMode.AutoFocus;
        }
        else if (focusType == 1)
        {
            NatCam.FocusMode = FocusMode.HybridFocus;
        }
        else if (focusType == 2)
        {
            NatCam.FocusMode = FocusMode.Off;
        }

        if (displaySizeType == 0)
        {
            transform.localScale = new Vector3(5f, 10f, 1f);
        }
        else if (displaySizeType == 1)
        {
            transform.localScale = new Vector3(5f, 6f, 1f);
        }
        else if (displaySizeType == 1)
        {
            transform.localScale = new Vector3(5f, 3f, 1f);
        }
        float theHei   = transform.localScale.y;
        float theWidth = theHei * Screen.width / Screen.height;

        transform.localScale = new Vector3(theWidth, theHei, 1f);

        NatCam.Play();

        GetComponent <Renderer> ().material.mainTexture = NatCam.PreviewTexture;

        completeSetUp = true;
        _Menu.gameObject.SetActive(false);
        _TestUI.gameObject.SetActive(true);
    }