【Unity3D编辑器开发】Unity3D中制作一个可以随时查看键盘对应KeyCode值面板,方便开发

推荐阅读

  • CSDN主页
  • GitHub开源地址
  • Unity3D插件分享
  • 简书地址
  • 我的个人博客

大家好,我是佛系工程师☆恬静的小魔龙☆,不定时更新Unity开发技巧,觉得有用记得一键三连哦。

一、前言

在开发中,会遇到要使用监控键盘输入的KeyCode值来执行代码的情况。

比如说:

using System;
using UnityEditor;
using UnityEngine;public class Test01 : MonoBehaviour
{void Update(){if (Input.GetKeyDown(KeyCode.W)){Debug.Log("点击了键盘W");}}
}

但是,如果是一些不常用的键位,比如说{}[],这些KeyCode值就比较难查看了,因为API是这样的:
在这里插入图片描述
根本不知道这英文还是数字代表了啥,于是就诞生了,在Unity做一个键盘,然后在键盘的键位下标注每个键位的KeyCode值,方便开发。

先看下效果图:
在这里插入图片描述

小明:键位没有对齐,逼死强迫症啊喂!
张三:不重要!不重要!

二、正文

2-1、构建键盘键值表

让我们新建一个脚本,命名为VirtualKeyboardEditor.cs名字无所谓,主要是要继承与EditorWindow类,并且把脚本放到Editor文件夹内。

编辑代码:

using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;public class VirtualKeyboardEditor : EditorWindow
{[MenuItem("工具/键盘映射值")]static void OpenWindow(){GetWindow<VirtualKeyboardEditor>().Show();}//用于绘制窗口内容private void OnGUI(){}
}

然后,我们需要写一个自定义类,用来保存键盘值名和KeyCode值,以及长宽。

// 键盘映射value值
public class VirKeyValue
{public float height;public float width;public string name;public string key;public VirKeyValue(string name, string key, float width, float height){this.name = name;this.width = width;this.height = height;this.key = key;}
}

接着构建键值库:

static Dictionary<int, List<VirKeyValue>> dicVirKeys;const int width1 = 50;const int width2 = 80;const int width100 = 100;const int width120 = 120;const int width140 = 138;const int width3 = 300;const int height1 = 30;private void DataInit(){if (dicVirKeys == null){dicVirKeys = new Dictionary<int, List<VirKeyValue>>();List<VirKeyValue> tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Esc","Esc", width1, height1),new VirKeyValue("F1","F1", width1, height1),new VirKeyValue("F2","F2", width1, height1),new VirKeyValue("F3","F3", width1, height1),new VirKeyValue("F4","F4", width1, height1),new VirKeyValue("F5","F5", width1, height1),new VirKeyValue("F6","F6", width1, height1),new VirKeyValue("F7","F7", width1, height1),new VirKeyValue("F8","F8", width1, height1),new VirKeyValue("F9","F9", width1, height1),new VirKeyValue("F10","F10", width1, height1),new VirKeyValue("F11","F11", width1, height1),new VirKeyValue("F12","F12", width1, height1),new VirKeyValue("Print\nScreen","Print", width1, height1),new VirKeyValue("Scroll\nLock", "ScrollLockScroll",width1, height1),new VirKeyValue("Pause","Pause", width1, height1)};dicVirKeys.Add(0, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("~\n`","BackQuote", width1, height1),new VirKeyValue("!\n1","Alpha1", width1, height1),new VirKeyValue("@\n2","Alpha2", width1, height1),new VirKeyValue("#\n3","Alpha3", width1, height1),new VirKeyValue("$\n4","Alpha4", width1, height1),new VirKeyValue("%\n5","Alpha5", width1, height1),new VirKeyValue("^\n6","Alpha6", width1, height1),new VirKeyValue("&\n7","Alpha7", width1, height1),new VirKeyValue("*\n8","Alpha8", width1, height1),new VirKeyValue("(\n9","Alpha9", width1, height1),new VirKeyValue(")\n0","Alpha0", width1, height1),new VirKeyValue("_\n-","Minus", width1, height1),new VirKeyValue("+\n=","Equals", width1, height1),new VirKeyValue("←Backspace","Backspace", width120, height1),new VirKeyValue("Insert","Insert", width1, height1),new VirKeyValue("Home", "Home",width1, height1),new VirKeyValue("Page\nUp", "PageUp",width1, height1),new VirKeyValue("NumLk","Numlock", width1, height1),new VirKeyValue("/","KeypadDivide", width1, height1),new VirKeyValue("*","KeypadMultiply", width1, height1),new VirKeyValue("-","KeypadMinus", width1, height1),};dicVirKeys.Add(1, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Tab","Tab", width100, height1),new VirKeyValue("Q","Q",width1, height1),new VirKeyValue("W","W",width1, height1),new VirKeyValue("E","E",width1, height1),new VirKeyValue("R","R",width1, height1),new VirKeyValue("T","T",width1, height1),new VirKeyValue("Y","Y",width1, height1),new VirKeyValue("U","U",width1, height1),new VirKeyValue("I","I",width1, height1),new VirKeyValue("O","O",width1, height1),new VirKeyValue("P","P",width1, height1),new VirKeyValue("{\n[","LeftBracket", width1, height1),new VirKeyValue("}\n]","RightBracket", width1, height1),new VirKeyValue("|\n\\", "Backslash",70, height1),new VirKeyValue("Delete", "Delete",width1, height1),new VirKeyValue("End", "End",width1, height1),new VirKeyValue("Page\nDown","PageDown", width1, height1),new VirKeyValue("7","Keypad7",width1, height1),new VirKeyValue("8","Keypad8",width1, height1),new VirKeyValue("9","Keypad9",width1, height1),new VirKeyValue("+","KeypadPlus",width1, height1),};dicVirKeys.Add(2, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Caps\nLock","Backspace", width120, height1),new VirKeyValue("A","A", width1, height1),new VirKeyValue("S","S", width1, height1),new VirKeyValue("D","D", width1, height1),new VirKeyValue("F","F", width1, height1),new VirKeyValue("G","G", width1, height1),new VirKeyValue("H","H", width1, height1),new VirKeyValue("J","J", width1, height1),new VirKeyValue("K","K", width1, height1),new VirKeyValue("L","L", width1, height1),new VirKeyValue(":\n;","Semicolon", width1, height1),new VirKeyValue("\"\n'","Quote", width1, height1),new VirKeyValue("Enter","Enter", 104, height1),new VirKeyValue("4","Keypad4",width1, height1),new VirKeyValue("5","Keypad5",width1, height1),new VirKeyValue("6","Keypad6",width1, height1),new VirKeyValue("Enter","KeypadEnter", width1, height1),};dicVirKeys.Add(3, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Shift","LeftShift", width140, height1),new VirKeyValue("Z","Z",width1, height1),new VirKeyValue("X","X",width1, height1),new VirKeyValue("C","C",width1, height1),new VirKeyValue("V","V",width1, height1),new VirKeyValue("B","B",width1, height1),new VirKeyValue("N","N",width1, height1),new VirKeyValue("M","M",width1, height1),new VirKeyValue("<\n,","Comma", width1, height1),new VirKeyValue(">\n.","Period", width1, height1),new VirKeyValue("?\n/","Slash", width1, height1),new VirKeyValue("Shift","RightControl", width140, height1),new VirKeyValue("↑","UpArrow", width1, height1),new VirKeyValue("1","Keypad1", width1, height1),new VirKeyValue("2","Keypad2", width1, height1),new VirKeyValue("3","Keypad3", width1, height1),};dicVirKeys.Add(4, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Ctrl","LeftControl", width2, height1),new VirKeyValue("Win", "LeftWindows",width1, height1),new VirKeyValue("Alt", "LeftAlt",width1, height1),new VirKeyValue("—————Space———","Space", width3, height1),new VirKeyValue("Alt", "RightAlt",width1, height1),new VirKeyValue("Ctrl", "RightControl",width2, height1),new VirKeyValue("←","LeftArrow",width1, height1),new VirKeyValue("↓","DownArrow",width1, height1),new VirKeyValue("→","RightArrow",width1, height1),new VirKeyValue("0","Keypad0",width100, height1),new VirKeyValue(".","KeypadPeriod",width1, height1),};dicVirKeys.Add(5, tempVirKeys);}}

整体代码如下:

using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;// 键盘映射value值
public class VirKeyValue
{public float height;public float width;public string name;public string key;public VirKeyValue(string name, string key, float width, float height){this.name = name;this.width = width;this.height = height;this.key = key;}
}
public class VirtualKeyboardEditor : EditorWindow
{[MenuItem("工具/键盘映射值")]static void OpenWindow(){GetWindow<VirtualKeyboardEditor>().Show();}static Dictionary<int, List<VirKeyValue>> dicVirKeys;const int width1 = 50;const int width2 = 80;const int width100 = 100;const int width120 = 120;const int width140 = 138;const int width3 = 300;const int height1 = 30;private void DataInit(){if (dicVirKeys == null){dicVirKeys = new Dictionary<int, List<VirKeyValue>>();List<VirKeyValue> tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Esc","Esc", width1, height1),new VirKeyValue("F1","F1", width1, height1),new VirKeyValue("F2","F2", width1, height1),new VirKeyValue("F3","F3", width1, height1),new VirKeyValue("F4","F4", width1, height1),new VirKeyValue("F5","F5", width1, height1),new VirKeyValue("F6","F6", width1, height1),new VirKeyValue("F7","F7", width1, height1),new VirKeyValue("F8","F8", width1, height1),new VirKeyValue("F9","F9", width1, height1),new VirKeyValue("F10","F10", width1, height1),new VirKeyValue("F11","F11", width1, height1),new VirKeyValue("F12","F12", width1, height1),new VirKeyValue("Print\nScreen","Print", width1, height1),new VirKeyValue("Scroll\nLock", "ScrollLockScroll",width1, height1),new VirKeyValue("Pause","Pause", width1, height1)};dicVirKeys.Add(0, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("~\n`","BackQuote", width1, height1),new VirKeyValue("!\n1","Alpha1", width1, height1),new VirKeyValue("@\n2","Alpha2", width1, height1),new VirKeyValue("#\n3","Alpha3", width1, height1),new VirKeyValue("$\n4","Alpha4", width1, height1),new VirKeyValue("%\n5","Alpha5", width1, height1),new VirKeyValue("^\n6","Alpha6", width1, height1),new VirKeyValue("&\n7","Alpha7", width1, height1),new VirKeyValue("*\n8","Alpha8", width1, height1),new VirKeyValue("(\n9","Alpha9", width1, height1),new VirKeyValue(")\n0","Alpha0", width1, height1),new VirKeyValue("_\n-","Minus", width1, height1),new VirKeyValue("+\n=","Equals", width1, height1),new VirKeyValue("←Backspace","Backspace", width120, height1),new VirKeyValue("Insert","Insert", width1, height1),new VirKeyValue("Home", "Home",width1, height1),new VirKeyValue("Page\nUp", "PageUp",width1, height1),new VirKeyValue("NumLk","Numlock", width1, height1),new VirKeyValue("/","KeypadDivide", width1, height1),new VirKeyValue("*","KeypadMultiply", width1, height1),new VirKeyValue("-","KeypadMinus", width1, height1),};dicVirKeys.Add(1, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Tab","Tab", width100, height1),new VirKeyValue("Q","Q",width1, height1),new VirKeyValue("W","W",width1, height1),new VirKeyValue("E","E",width1, height1),new VirKeyValue("R","R",width1, height1),new VirKeyValue("T","T",width1, height1),new VirKeyValue("Y","Y",width1, height1),new VirKeyValue("U","U",width1, height1),new VirKeyValue("I","I",width1, height1),new VirKeyValue("O","O",width1, height1),new VirKeyValue("P","P",width1, height1),new VirKeyValue("{\n[","LeftBracket", width1, height1),new VirKeyValue("}\n]","RightBracket", width1, height1),new VirKeyValue("|\n\\", "Backslash",70, height1),new VirKeyValue("Delete", "Delete",width1, height1),new VirKeyValue("End", "End",width1, height1),new VirKeyValue("Page\nDown","PageDown", width1, height1),new VirKeyValue("7","Keypad7",width1, height1),new VirKeyValue("8","Keypad8",width1, height1),new VirKeyValue("9","Keypad9",width1, height1),new VirKeyValue("+","KeypadPlus",width1, height1),};dicVirKeys.Add(2, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Caps\nLock","Backspace", width120, height1),new VirKeyValue("A","A", width1, height1),new VirKeyValue("S","S", width1, height1),new VirKeyValue("D","D", width1, height1),new VirKeyValue("F","F", width1, height1),new VirKeyValue("G","G", width1, height1),new VirKeyValue("H","H", width1, height1),new VirKeyValue("J","J", width1, height1),new VirKeyValue("K","K", width1, height1),new VirKeyValue("L","L", width1, height1),new VirKeyValue(":\n;","Semicolon", width1, height1),new VirKeyValue("\"\n'","Quote", width1, height1),new VirKeyValue("Enter","Enter", 104, height1),new VirKeyValue("4","Keypad4",width1, height1),new VirKeyValue("5","Keypad5",width1, height1),new VirKeyValue("6","Keypad6",width1, height1),new VirKeyValue("Enter","KeypadEnter", width1, height1),};dicVirKeys.Add(3, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Shift","LeftShift", width140, height1),new VirKeyValue("Z","Z",width1, height1),new VirKeyValue("X","X",width1, height1),new VirKeyValue("C","C",width1, height1),new VirKeyValue("V","V",width1, height1),new VirKeyValue("B","B",width1, height1),new VirKeyValue("N","N",width1, height1),new VirKeyValue("M","M",width1, height1),new VirKeyValue("<\n,","Comma", width1, height1),new VirKeyValue(">\n.","Period", width1, height1),new VirKeyValue("?\n/","Slash", width1, height1),new VirKeyValue("Shift","RightControl", width140, height1),new VirKeyValue("↑","UpArrow", width1, height1),new VirKeyValue("1","Keypad1", width1, height1),new VirKeyValue("2","Keypad2", width1, height1),new VirKeyValue("3","Keypad3", width1, height1),};dicVirKeys.Add(4, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Ctrl","LeftControl", width2, height1),new VirKeyValue("Win", "LeftWindows",width1, height1),new VirKeyValue("Alt", "LeftAlt",width1, height1),new VirKeyValue("—————Space———","Space", width3, height1),new VirKeyValue("Alt", "RightAlt",width1, height1),new VirKeyValue("Ctrl", "RightControl",width2, height1),new VirKeyValue("←","LeftArrow",width1, height1),new VirKeyValue("↓","DownArrow",width1, height1),new VirKeyValue("→","RightArrow",width1, height1),new VirKeyValue("0","Keypad0",width100, height1),new VirKeyValue(".","KeypadPeriod",width1, height1),};dicVirKeys.Add(5, tempVirKeys);}}//用于绘制窗口内容private void OnGUI(){}
}

2-2、界面绘制

using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;// 键盘映射value值
public class VirKeyValue
{public float height;public float width;public string name;public string key;public VirKeyValue(string name, string key, float width, float height){this.name = name;this.width = width;this.height = height;this.key = key;}
}
public class VirtualKeyboardEditor : EditorWindow
{[MenuItem("工具/键盘映射值")]static void OpenWindow(){GetWindow<VirtualKeyboardEditor>().Show();}static Dictionary<int, List<VirKeyValue>> dicVirKeys;const int width1 = 50;const int width2 = 80;const int width100 = 100;const int width120 = 120;const int width140 = 138;const int width3 = 300;const int height1 = 30;private void DataInit(){if (dicVirKeys == null){dicVirKeys = new Dictionary<int, List<VirKeyValue>>();List<VirKeyValue> tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Esc","Esc", width1, height1),new VirKeyValue("F1","F1", width1, height1),new VirKeyValue("F2","F2", width1, height1),new VirKeyValue("F3","F3", width1, height1),new VirKeyValue("F4","F4", width1, height1),new VirKeyValue("F5","F5", width1, height1),new VirKeyValue("F6","F6", width1, height1),new VirKeyValue("F7","F7", width1, height1),new VirKeyValue("F8","F8", width1, height1),new VirKeyValue("F9","F9", width1, height1),new VirKeyValue("F10","F10", width1, height1),new VirKeyValue("F11","F11", width1, height1),new VirKeyValue("F12","F12", width1, height1),new VirKeyValue("Print\nScreen","Print", width1, height1),new VirKeyValue("Scroll\nLock", "ScrollLockScroll",width1, height1),new VirKeyValue("Pause","Pause", width1, height1)};dicVirKeys.Add(0, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("~\n`","BackQuote", width1, height1),new VirKeyValue("!\n1","Alpha1", width1, height1),new VirKeyValue("@\n2","Alpha2", width1, height1),new VirKeyValue("#\n3","Alpha3", width1, height1),new VirKeyValue("$\n4","Alpha4", width1, height1),new VirKeyValue("%\n5","Alpha5", width1, height1),new VirKeyValue("^\n6","Alpha6", width1, height1),new VirKeyValue("&\n7","Alpha7", width1, height1),new VirKeyValue("*\n8","Alpha8", width1, height1),new VirKeyValue("(\n9","Alpha9", width1, height1),new VirKeyValue(")\n0","Alpha0", width1, height1),new VirKeyValue("_\n-","Minus", width1, height1),new VirKeyValue("+\n=","Equals", width1, height1),new VirKeyValue("←Backspace","Backspace", width120, height1),new VirKeyValue("Insert","Insert", width1, height1),new VirKeyValue("Home", "Home",width1, height1),new VirKeyValue("Page\nUp", "PageUp",width1, height1),new VirKeyValue("NumLk","Numlock", width1, height1),new VirKeyValue("/","KeypadDivide", width1, height1),new VirKeyValue("*","KeypadMultiply", width1, height1),new VirKeyValue("-","KeypadMinus", width1, height1),};dicVirKeys.Add(1, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Tab","Tab", width100, height1),new VirKeyValue("Q","Q",width1, height1),new VirKeyValue("W","W",width1, height1),new VirKeyValue("E","E",width1, height1),new VirKeyValue("R","R",width1, height1),new VirKeyValue("T","T",width1, height1),new VirKeyValue("Y","Y",width1, height1),new VirKeyValue("U","U",width1, height1),new VirKeyValue("I","I",width1, height1),new VirKeyValue("O","O",width1, height1),new VirKeyValue("P","P",width1, height1),new VirKeyValue("{\n[","LeftBracket", width1, height1),new VirKeyValue("}\n]","RightBracket", width1, height1),new VirKeyValue("|\n\\", "Backslash",70, height1),new VirKeyValue("Delete", "Delete",width1, height1),new VirKeyValue("End", "End",width1, height1),new VirKeyValue("Page\nDown","PageDown", width1, height1),new VirKeyValue("7","Keypad7",width1, height1),new VirKeyValue("8","Keypad8",width1, height1),new VirKeyValue("9","Keypad9",width1, height1),new VirKeyValue("+","KeypadPlus",width1, height1),};dicVirKeys.Add(2, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Caps\nLock","Backspace", width120, height1),new VirKeyValue("A","A", width1, height1),new VirKeyValue("S","S", width1, height1),new VirKeyValue("D","D", width1, height1),new VirKeyValue("F","F", width1, height1),new VirKeyValue("G","G", width1, height1),new VirKeyValue("H","H", width1, height1),new VirKeyValue("J","J", width1, height1),new VirKeyValue("K","K", width1, height1),new VirKeyValue("L","L", width1, height1),new VirKeyValue(":\n;","Semicolon", width1, height1),new VirKeyValue("\"\n'","Quote", width1, height1),new VirKeyValue("Enter","Enter", 104, height1),new VirKeyValue("4","Keypad4",width1, height1),new VirKeyValue("5","Keypad5",width1, height1),new VirKeyValue("6","Keypad6",width1, height1),new VirKeyValue("Enter","KeypadEnter", width1, height1),};dicVirKeys.Add(3, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Shift","LeftShift", width140, height1),new VirKeyValue("Z","Z",width1, height1),new VirKeyValue("X","X",width1, height1),new VirKeyValue("C","C",width1, height1),new VirKeyValue("V","V",width1, height1),new VirKeyValue("B","B",width1, height1),new VirKeyValue("N","N",width1, height1),new VirKeyValue("M","M",width1, height1),new VirKeyValue("<\n,","Comma", width1, height1),new VirKeyValue(">\n.","Period", width1, height1),new VirKeyValue("?\n/","Slash", width1, height1),new VirKeyValue("Shift","RightControl", width140, height1),new VirKeyValue("↑","UpArrow", width1, height1),new VirKeyValue("1","Keypad1", width1, height1),new VirKeyValue("2","Keypad2", width1, height1),new VirKeyValue("3","Keypad3", width1, height1),};dicVirKeys.Add(4, tempVirKeys);tempVirKeys = new List<VirKeyValue>{new VirKeyValue("Ctrl","LeftControl", width2, height1),new VirKeyValue("Win", "LeftWindows",width1, height1),new VirKeyValue("Alt", "LeftAlt",width1, height1),new VirKeyValue("—————Space———","Space", width3, height1),new VirKeyValue("Alt", "RightAlt",width1, height1),new VirKeyValue("Ctrl", "RightControl",width2, height1),new VirKeyValue("←","LeftArrow",width1, height1),new VirKeyValue("↓","DownArrow",width1, height1),new VirKeyValue("→","RightArrow",width1, height1),new VirKeyValue("0","Keypad0",width100, height1),new VirKeyValue(".","KeypadPeriod",width1, height1),};dicVirKeys.Add(5, tempVirKeys);}}//用于绘制窗口内容private void OnGUI(){DataInit();GUILayout.Label("Note:在开发中会遇到使用监控键盘输入的情况,但是KeyCode的值往往分不清楚,此工具就是跟键盘一一对应的Key值,不清楚的时候" +"看一眼就行了,当然,也可以点击按钮,点击后可以打印当前KeyCode值。");for (int i = 0; i < dicVirKeys.Count; i++){GUILayout.BeginVertical();OnRow(i);GUILayout.EndVertical();}}void OnRow(int index){GUILayout.BeginHorizontal();for (int i = 0; i < dicVirKeys[index].Count; i++){if (dicVirKeys[index][i].name == "↑"){GUILayout.Space(50);}else if (dicVirKeys[index][i].name == "←"){GUILayout.Space(180);}else if (dicVirKeys[index][i].name == "4"){GUILayout.Space(160);}else if (dicVirKeys[index][i].name == "1"){GUILayout.Space(60);}else if (dicVirKeys[index][i].name == "0"){GUILayout.Space(6);}GUILayout.BeginVertical();if (GUILayout.Button(dicVirKeys[index][i].name, GUILayout.Width(dicVirKeys[index][i].width), GUILayout.Height(dicVirKeys[index][i].height))){Debug.Log("当前按下的键位是 : KeyCode." + dicVirKeys[index][i].key);}GUILayout.Label(dicVirKeys[index][i].key);GUILayout.EndVertical();if (dicVirKeys[index][i].name == "Esc"){GUILayout.Space(52);}else if (dicVirKeys[index][i].name == "F4"){GUILayout.Space(36);}else if (dicVirKeys[index][i].name == "F8"){GUILayout.Space(36);}}GUILayout.EndHorizontal();}
}

然后在Untiy编辑器的Edit栏,选择工具→键盘映射值打开面板:
在这里插入图片描述

三、后记

如果觉得本篇文章有用别忘了点个关注,关注不迷路,持续分享更多Unity干货文章。


你的点赞就是对博主的支持,有问题记得留言:

博主主页有联系方式。

博主还有跟多宝藏文章等待你的发掘哦:

专栏方向简介
Unity3D开发小游戏小游戏开发教程分享一些使用Unity3D引擎开发的小游戏,分享一些制作小游戏的教程。
Unity3D从入门到进阶入门从自学Unity中获取灵感,总结从零开始学习Unity的路线,有C#和Unity的知识。
Unity3D之UGUIUGUIUnity的UI系统UGUI全解析,从UGUI的基础控件开始讲起,然后将UGUI的原理,UGUI的使用全面教学。
Unity3D之读取数据文件读取使用Unity3D读取txt文档、json文档、xml文档、csv文档、Excel文档。
Unity3D之数据集合数据集合数组集合:数组、List、字典、堆栈、链表等数据集合知识分享。
Unity3D之VR/AR(虚拟仿真)开发虚拟仿真总结博主工作常见的虚拟仿真需求进行案例讲解。
Unity3D之插件插件主要分享在Unity开发中用到的一些插件使用方法,插件介绍等
Unity3D之日常开发日常记录主要是博主日常开发中用到的,用到的方法技巧,开发思路,代码分享等
Unity3D之日常BUG日常记录记录在使用Unity3D编辑器开发项目过程中,遇到的BUG和坑,让后来人可以有些参考。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/153250.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

10月10日星期二今日早报简报微语报早读

10月10日&#xff0c;星期二&#xff0c;早报简报微语早读分享。 1、全国铁路国庆黄金周运输发送旅客1.95亿人次&#xff1b; 2、贵州公安&#xff1a;三名抢劫杀人嫌犯潜逃至缅北电诈窝点&#xff0c;全部落网&#xff1b; 3、四川&#xff1a;游客擅自进入未开发开放游览活动…

【debian 12】:debian系统切换中文界面

目录 目录 项目场景 基础参数 原因分析 解决方案 1.ctrlaltT 打开终端 2.查询当前语言环境&#xff08;我的已经设置成了中文 zh_CN.UTF-8&#xff09; 3.打开语言配置界面 4.最后一步&#xff1a;重启 不要放弃任何一个机会&#xff01; 项目场景&#xff1a; 这两…

【three.js】结合vue进行开发第一个3d页面

一、创建vue项目 新建一个项目目录&#xff0c;在集成终端打开&#xff0c;输入 npm init vitelatest 回车后&#xff0c;依次输入项目名&#xff0c;选择vue和js开发 然后安装依赖并运行项目 二、安装three 接下来我们开始安装three npm install three 三、Three.js 的…

LeetCode-94-二叉树的中序遍历

题目描述&#xff1a; 题目链接&#xff1a;LeetCode-94-二叉树的中序遍历 解题思路&#xff1a;递归&#xff0c;具体可以参考 LeetCode-144-二叉树的前序遍历 代码实现&#xff1a; class Solution {List<Integer> listnew ArrayList<>();public List<Integer…

什么是云计算?云计算简介

其实“云计算”作为一个名词而言&#xff0c;那是相当成功滴。很多人都有听过。但提及云计算”具体是什么?很多人&#xff0c;知其然&#xff0c;却不知其所以然! 利用软件将这些成千上万不可靠的硬件组织成一个稳定可靠的IT系统&#xff0c;以此支撑其公司的IT基础服务。这家…

对音频切分成小音频(机器学习用)

我是把so-vits中小工具&#xff0c;分析源码然后提取出来了。以后可以写在自己的程序里。 -------流程&#xff08;这是我做的流程&#xff0c;你可以不用看&#xff09; 从开源代码中快速获取自己需要的东西 如果有界面f12看他里面的接口&#xff0c;然后在源码中全局搜索&…

U盘部分文件无故消失?3招帮你恢复数据!

“怎么会这样呢&#xff1f;我的u盘有一段时间没用了&#xff0c;今天把它插入电脑后发现有些文件无故消失了&#xff0c;明明我也没有删除这些文件啊。还有办法可以找回它们吗&#xff1f;” U盘作为便捷小巧的存储工具&#xff0c;逐渐成为人们数据存储的好帮手。但在使用u盘…

从0开始python学习-31.selenium 文本输入框、下拉选择框、文件上传、时间插件选择元素定位

目录 1. 纯文本输入框 2. 存在默认值的文本输入 3. 下拉选择框 4. 输入后下拉选择框 5. 文件上传 6. 时间插件 1. 纯文本输入框 driver.find_element(By.XPATH,/html/body/div[2]/td[2]/input).send_keys(测试名称) 2. 存在默认值的文本输入 注意&#xff1a; 1. 这种存…

PET/MRI:技术和方法

前言 多模态信息通常用于诊断或研究的目的&#xff0c;因为每种成像技术提供了互补的信息&#xff0c;例如有关解剖学、生理学或代谢的信息。正电子发射断层扫描(PET)测量体内特定分子的分布和浓度&#xff0c;磁共振成像(MRI)反映质子密度和组织弛豫时间&#xff0c;计算机断…

非线性权重纵横交叉t分布改进麻雀算法

目录 1 横向交叉操作 2 纵向交叉操作 3 非线性惯性权重 4 基于t分布变异 5 实验结果 1 横向交叉操作 横向交叉操作类似于遗传算法中的交叉操作&#xff0c;是在不同 种群的相同维度中进行交叉运算。针对麻雀搜索算法全局 搜索能力不强的问题&#xff0c;本文应用横向交叉策…

VR酒店虚拟仿真情景实训教学演示

在传统的酒店管理教学过程中&#xff0c;学生往往缺乏实践操作经验&#xff0c;难以将理论知识与实际工作相结合。而VR酒店虚拟仿真情景实训教学应用可以为学生提供一个逼真的、沉浸式的酒店管理环境&#xff0c;使学生能够在模拟实践中掌握酒店管理的各项技能。 VR酒店虚拟仿真…

阿里云 腾讯云 配置二级域名并解析指向非80端口操作指南

目标&#xff1a;主域名 imps.com 已完成配置&#xff0c;新增配置 kpi.imps.com 等二级域名并指向 8083 端口。 &#xff08;此操作需要主域名已经通过备案3天后&#xff0c;最好指向的IP地址网站也通过了备案申请&#xff0c;否则会提示域名没有备案。&#xff09; 操作流程…

使用 nodejs,SpringBoot 两种方式实现 WebSocket

前言 WebSocket 是一种在单个 TCP 连接上进行全双工通信的协议&#xff0c;它可以让浏览器和服务器之间实现实时双向数据传输。 WebSocket 的优点是&#xff1a; 可以节省服务器资源和带宽&#xff0c;提高性能和效率可以让服务器主动向客户端推送数据&#xff0c;实现实时响…

HarmonyOS/OpenHarmony原生应用-ArkTS万能卡片组件Stack

堆叠容器&#xff0c;子组件按照顺序依次入栈&#xff0c;后一个子组件覆盖前一个子组件。该组件从API Version 7开始支持。可以包含子组件。 一、接口 Stack(value?: { alignContent?: Alignment }) 从API version 9开始&#xff0c;该接口支持在ArkTS卡片中使用。 二、…

alsa pcm接口之pcm设备的状态STATE

应用和库之间的协作: ALSA pcm api设计使用状态来确定应用程序和库之间的通信阶段,实际的状态可以被决定通过使用snd_pcm_state调用,下面列举出来状态: SND_PCM_STATE_OPEN: 表示pcm设备被打开的状态,使用了snd_pcm_open()之后进入该状态,并且让snd_pcm_hw_params()调用失败后,…

linux,write:xxx has messages disabled 与 Ubuntu多用户同时登录的问题 ubuntu 20.04

write&#xff1a;xxx has messages disabled 问题 被这问题折磨了好久&#xff0c;搜都搜不到&#xff0c;还是灵机一动想到的。 很多 帖子说&#xff0c;要使用 mesg y用了还是没有用&#xff0c;后面我登录了很多用户&#xff0c;发现只有root用户可以给别的用户使用write…

各类高危漏洞介绍及验证方式教程(一)

本期整理的漏洞验证教程约包含50多类漏洞&#xff0c;分多个章节编写&#xff0c;可从以下链接获取全文&#xff1a; 各类高危漏洞验证方式.docx (访问密码: 1455) 搭建dvwa测试环境基础教程.docx(访问密码: 1455) web逻辑漏洞挖掘快速入门基础教程.docx(访问密码: 1455) 01 Ca…

实验1机器学习之线性回归实验

一、实验目的&#xff1a; &#xff08;1&#xff09;理解一元线性回归和多元线性回归的数学原理&#xff0c;能够利用sklearn中相关库解决现实世界中的各类回归问题&#xff1b; &#xff08;2&#xff09;掌握利用matplotlib对一元线性回归模型进行可视化的方法&#xff0c…

【数据结构初阶】七、非线性表里的二叉树(堆的实现 -- C语言顺序结构)

相关代码gitee自取&#xff1a; C语言学习日记: 加油努力 (gitee.com) 接上期&#xff1a; 【数据结构初阶】六、线性表中的队列&#xff08;链式结构实现队列&#xff09;-CSDN博客 1 . 非线性表里的 树(Tree) 树的概念及结构&#xff1a; 树的概念 树是一种非线性的数据…

【计算机网络】高级IO初步理解

文章目录 1. 什么是IO&#xff1f;什么是高效 IO? 2. IO的五种模型五种IO模型的概念理解同步IO与异步IO整体理解 3. 阻塞IO4. 非阻塞IOsetnonblock函数为什么非阻塞IO会读取错误&#xff1f;对错误码的进一步判断检测数据没有就绪时&#xff0c;返回做一些其他事情完整代码myt…