implicit operator uint
Implicitly converts a RenderingLayerMask to an uint.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Operator
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
implicit operator uint(UInt3)
Implicitly converts a RenderingLayerMask to an .
uintpublic static implicit operator uint(RenderingLayerMask mask)
Parameters
Returns
Type | Description |
|---|---|
| uint |
implicit operator RenderingLayerMask(RenderingLayerMas)
Implicitly converts to a RenderingLayerMask.
uintpublic static implicit operator RenderingLayerMask(uint intVal)
Parameters
Returns
Type | Description |
|---|---|
| RenderingLayerMask |
Examples
using UnityEngine;using UnityEngine.Rendering;public class Example : MonoBehaviour{ void Start() { // Converts a uint to a rendering layer and prints all the rendering layer names. // As the value is 1025, it will print "Default" and Rendering Layer 10 Name. // 2^0 + 2^10 = 1 + 1024 = 1025 uint number = 1025; RenderingLayerMask mask = number; for (int i = 0; i < 32; i++) { if ((mask.value & (1 << i)) != 0) { Debug.Log($"Rendering Layer {i}: {RenderingLayerMask.RenderingLayerToName(i)}"); } } }}