public static string LayerToName (int layer);

描述

给定层编号,返回在 Tags and Layers manager 中的 Builtin 或 User Layer 中定义的层的名称。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Example() { Debug.Log(LayerMask.LayerToName(1)); } }

__注意:__.LayerToName 采用整数参数。此参数选择 层的名称并将其返回。层列在 Inspector 中。例如, 假设 User Layer 13 具有一个字符串。可以通过使用值 2^13(即 8192) 调用 LayerToName 来访问此字符串。