unity3d中C#枚举
来源:互联网 发布:文学书籍推荐 知乎 编辑:程序博客网 时间:2024/06/05 01:54
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
enum COLOR{RED,YELLOW,BLACK,WHITE,GREEN,BLUE};
COLOR a=COLOR.RED;
void Start () {
}
void Update () {
switch(a){
case COLOR.RED:
Debug.Log("this is Red");
break;
case COLOR.YELLOW:
Debug.Log ("this is Yellow");
break;
case COLOR.GREEN:
Debug.Log ("this is Green");
break;
case COLOR.WHITE:
Debug.Log ("this is White");
break;
case COLOR.BLACK:
Debug.Log ("this is Black");
break;
}
}
}
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
enum COLOR{RED,YELLOW,BLACK,WHITE,GREEN,BLUE};
COLOR a=COLOR.RED;
void Start () {
}
void Update () {
switch(a){
case COLOR.RED:
Debug.Log("this is Red");
break;
case COLOR.YELLOW:
Debug.Log ("this is Yellow");
break;
case COLOR.GREEN:
Debug.Log ("this is Green");
break;
case COLOR.WHITE:
Debug.Log ("this is White");
break;
case COLOR.BLACK:
Debug.Log ("this is Black");
break;
}
}
}
0 0
- unity3d中C#枚举
- unity3d 教程 C#枚举标志
- unity3D--枚举
- C#中 枚举的使用
- C#中 枚举的应用
- C# 中枚举的使用
- C#中枚举的使用
- Unity3d中 C# 单例类 <泛型>
- Unity3D中C#编写脚本
- 【Unity3d】在Unity3d中,使用C#中访问系统剪贴板
- unity3d中对枚举的使用--高度提取接口方法
- [Unity3D]uLua中类似Unity3D C# Messager的Event System
- C#中定义枚举类型数据
- C#中遍历枚举示例代码
- 在C#中枚举的作用(enum)
- C#中枚举类型的转换问题
- C#中枚举类型的使用总结
- c#中定义一个枚举类型
- NSData知识
- android开发如何切换横竖屏
- mysql分区及实例演示
- pair 测试
- Unigine(3)consle程序与unigine结合
- unity3d中C#枚举
- 类的前向声明
- 【C++】判断IP地址有效性
- NSSet知识以及练习题
- javascript jQuery
- 字典序最小问题 前后删除加入 贪心poj3617
- poj3253求切割木板开销最少是多少, 赫夫曼编码
- NSArray知识
- 阜阳师范学院网盘的一次上传漏洞经历