如何在Unity中的两个360视频背景天空盒之间淡入淡出

时间:2019-07-09 18:32:21

标签: c# unity3d virtual-reality

我希望能够在两个全景天空盒之间切换,其中有360个视频,并具有一种效果,其中一个视频可在命令中淡入另一个视频。我该怎么办?

我目前的场景切换天空盒之间没有渐变。我不知道在不更改当前解决方案的情况下是否能够达到我想要的效果


public class VideoChange : MonoBehaviour
{
    public int vidindex;
    public Material[] skyboxes;
    public GameObject menu;
    public TextMeshPro debugText;

    void Start()
    {
        RenderSettings.skybox = skyboxes[vidindex];
        DynamicGI.UpdateEnvironment();
    }

    void Update()
    {


        if (OVRInput.GetDown(OVRInput.Button.One))
        {
            if(vidindex != skyboxes.Length -1)
            {
                vidindex++;
            }
            else
            {
                vidindex = 0;
            }
            RenderSettings.skybox = skyboxes[vidindex];
            DynamicGI.UpdateEnvironment();
            Debug.Log("h3er");
        }
        if (OVRInput.GetDown(OVRInput.Button.Two))
        {
            if (vidindex != 0)
            {
                vidindex--;
            }
            else
            {
                vidindex = skyboxes.Length - 1;
            }
            RenderSettings.skybox = skyboxes[vidindex];
            DynamicGI.UpdateEnvironment();
            Debug.Log("h3er");
        }

    }


0 个答案:

没有答案