将图层蒙版值转换为整数。
using UnityEngine; using UnityEngine.Rendering;
public class Example : MonoBehaviour { // Set the rendering layer mask for MeshRenderer
RenderingLayerMask mask = 1 << 10; void Start() { GetComponent<MeshRenderer>().renderingLayerMask = mask; } }