본문 바로가기
개발/C#

유니티 C# String Enum 타입 간단 변환

by SPNK 2022. 10. 24.
반응형
  • 코드 작성
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public enum MoneyType
{
    Gold = 0,
    Crystal
}

public class ExampleEnum : MonoBehaviour
{
    void Start()
    {
        MoneyType moneyType = (MoneyType)Enum.Parse(typeof(MoneyType), "Gold");
    }
}

 

반응형

댓글