public class Anim : MonoBehaviour
{
public AnimType animType;
private void Start()
{
animType = (AnimType)System.Enum.Parse(typeof(AnimType), transform.name);
}
}
Unity---string转换为Enum枚举类型
最新推荐文章于 2022-07-11 11:37:04 发布