参考文档:https://docs.unity3d.com/ScriptReference/Shader.Find.html
改变color的alpha即可。
关键:Transparent/Diffuse
Material material = new Material(Shader.Find("Transparent/Diffuse")); material.color = Color.green; GetComponent<Renderer>().material = material;
时间: 2024-10-13 03:42:08