enum 열거형

using UnityEngine;
using System.Collections;

public class MouseClickTest : MonoBehaviour {

public enum State { Idle, Walk, Attack, Dead}
public State myState = State.Idle;


// Use this for initialization
void Start () {

}


// Update is called once per frame
void Update () {

if (myState == State.Walk) {
print("walk");
}

if (myState == State.Dead) {
print("walk");
}

if (myState == State.Attack) {
print("walk");
}




}
}

댓글

이 블로그의 인기 게시물

C++ 언어 퍼센트 구하는 방법 / 기본 언어 퍼센트 구하는 방법

ChatGPT로 10분만에 일잘러 되기 : 기초부터 실무까지 완전 정복: [패스트캠퍼스] ChatGPT 강의 완강 후기.