C#遍历枚举
来源:互联网 发布:女性脱发知乎 编辑:程序博客网 时间:2024/06/07 18:30
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TestKey : MonoBehaviour {
public TextMesh t;
// Use this for initialization
void Start () {
t = this.GetComponent<TextMesh>();
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.A))
{
ergodicEnum1();
}
}
private void ergodicEnum1()
{
foreach (KeyCode suit in Enum.GetValues(typeof(KeyCode)))
{
Debug.Log((int)suit + ":" + suit);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TestKey : MonoBehaviour {
public TextMesh t;
// Use this for initialization
void Start () {
t = this.GetComponent<TextMesh>();
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.A))
{
ergodicEnum1();
}
}
private void ergodicEnum1()
{
foreach (KeyCode suit in Enum.GetValues(typeof(KeyCode)))
{
Debug.Log((int)suit + ":" + suit);
}
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TestKey : MonoBehaviour {
public TextMesh t;
// Use this for initialization
void Start () {
t = this.GetComponent<TextMesh>();
}
// Update is called once per frame
void Update () {
//if (Input.GetKey(KeyCode.A))
//{
ergodicEnum1();
//}
}
private void ergodicEnum1()
{
foreach (KeyCode suit in Enum.GetValues(typeof(KeyCode)))
{
if (Input.GetKeyDown(suit))
{
Debug.Log((int)suit + ":" + suit);
t.text = (int)suit + ":" + suit;
}
}
}
}
阅读全文
0 0
- C#遍历Struct,遍历枚举
- C#遍历枚举
- C#遍历枚举
- c#遍历枚举
- C# 遍历枚举
- C# 遍历枚举
- C#遍历枚举类型
- C#遍历枚举类型
- C# 遍历枚举类型
- C#枚举遍历--Enum
- C#遍历枚举
- c#枚举遍历(转换)
- C#中遍历枚举示例代码
- C#遍历枚举类型的所有元素
- C#遍历枚举(Enum)值
- 枚举遍历
- c# 遍历枚举(转自博客园)
- C# 获取枚举的 键名称,值 和描述 遍历枚举
- Hamcrest
- 第一次上云是什么体验
- 第一章软件危机与软件工程
- 第一篇:Docker简单介绍及安装使用
- JVM学习笔记之JAVA内存模型
- C#遍历枚举
- Android Studio For Mac 启动模拟机时关于“Intel HAXM is required to run this AVD,VT-x is disabled in BIOS”问题
- 设计师如何让自己的想法落地
- 负边距居中法
- [初学笔记] matlab中的 xor 的使用
- while(1) 与for(;;) 的区别
- (4.3.2.23) Compare报错: Comparison method violates its general contract!
- Redis数据库存储和过期键实现原理
- 栈帧、局部变量表、操作数栈