Version: 2017.1

Animator.GetLayerIndex

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