Version: 2018.4
public static int NameToLayer (string layerName);

説明

レイヤー名が与えられ、Builtin か Tags and Layers manager の User Layer で定義されているレイヤーのインデックスを返します。

Returns -1 if not found.

using UnityEngine;

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