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");
}
}
}
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");
}
}
}
댓글
댓글 쓰기