Version: 2017.2

Animator.GetLayerIndex

切换到手册
public int GetLayerIndex (string layerName);