借鉴:
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(); } }
原创文章,作者:254126420,如若转载,请注明出处:https://blog.ytso.com/245508.html