기술 자료

Unity Engine

Unity Engine

NameToRenderingLayer(string)

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

Definition

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

Parameters

layerName

Provide a rendering layer name.

Returns

Type

Description

intReturns -1 if not found.

Examples

using UnityEngine;using UnityEngine.Rendering;public class Example : MonoBehaviour{ void Start() { // Prints the name of the rendering layer 1 Debug.Log(RenderingLayerMask.NameToRenderingLayer("Default")); }}