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");
}




}
}

댓글

이 블로그의 인기 게시물

날짜 시간 시간차 시간 계산 하기

코루틴에서 CallBack 함수 적용하기

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