기술 자료

Unity Engine

Unity Engine

NameToLayer(string)

Given a layer name, returns the layer index as defined by either a Builtin or a User Layer in the Tags and Layers manager.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static int NameToLayer(string layerName)

Parameters

layerName

Returns

Type

Description

int

Remarks

Returns -1 if not found.

Examples

using UnityEngine;public class Example : MonoBehaviour{ void Start() { Debug.Log(LayerMask.NameToLayer("TransparentFX")); }}