借鉴:

 

https://blog.csdn.net/lihui061119/article/details/116714733

 

https://blog.csdn.net/zhangay1998/article/details/120324637

 

代码:

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;

public class Switch_Sun_On_1 : UdonSharpBehaviour
{
    public Material sky;
    
    public override void Interact()
    {
        RenderSettings.skybox = sky;
    }
}

 

 

有问题版本(看报错是udon不支持)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class skychange : MonoBehaviour
{
    public Material sky2;
    
    void Update()
    {
        RenderSettings.skybox = sky2;
        DynamicGI.UpdateEnvironment();
    }

}

 

posted on 2022-04-18 00:23  月零Ray  阅读(226)  评论(0编辑  收藏  举报