其他分享
首页 > 其他分享> > VRChat切换天空盒脚本

VRChat切换天空盒脚本

作者:互联网

借鉴:

 

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();
    }

}

 

标签:脚本,UnityEngine,VRChat,System,csdn,切换,article,using,public
来源: https://www.cnblogs.com/raitorei/p/16157995.html