public class xxxxennum : MonoBehaviour {
public enum PlayerType{
Soldier,Nurse,BlackSmith
}
public PlayerType playerType;
// Use this for initialization
void Start () {
SayHello();
}
void SayHello(){
switch (playerType) {
case PlayerType.Soldier:
print ("我是战士");
break;
case PlayerType.Nurse:
print ("我是护士为你疗伤");
break;
case PlayerType.BlackSmith:
print ("我是黑巧克力");
break;
}
}
}
时间: 2024-10-15 10:14:15