LayerMask.LayerToName 层名称

static function LayerToName (layer : int) : string

Description描述

Given a layer number, returns the name of the layer as defined in either a Builtin or a User Layer in the Tag Manager

给定一个层数,返回内置的或在tag Maneger中定义的层名称。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		Debug.Log(LayerMask.LayerToName(1));
	}
}
// Prints the name of the layer 1
//打印层1的名字

Debug.Log(LayerMask.LayerToName(1));
Page last updated: 2011-2-24