【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.hqwc.cn/news/132627.html

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

相关文章

从零开始探索C语言(十一)----共用体和位域

文章目录 1. 共用体1.1 定义共用体1.2 访问共用体成员 2. 位域2.1 位域声明2.2 位域的定义和位域变量的说明2.3 位域的使用2.4 位域小结 1. 共用体 共用体是一种特殊的数据类型&#xff0c;允许您在相同的内存位置存储不同的数据类型。您可以定义一个带有多成员的共用体&#…

微信小程序 movable-view 控制长按才触发拖动 轻轻滑动页面正常滚动效果

今天写 movable-areamovable-view遇到了个头疼的问题 那就是 movable-view 监听了用户拖拽自己 但 我们小程序 上下滚动页面靠的也是拖拽 也就是说 如果放在这里 用户拖动 movable-view部分 就会永远触发不了滚动 那么 我们先可以 加一个 bindlongpress"longpressHandler…

数据结构—顺序表

目录 1.线性表 2.顺序表概念 3.实现顺序表 (1)声明结构体 (2)初始化 (3)打印数据 (4) 销毁 (5)尾插&头插 尾插 判断是否扩容 头插 (6)尾删&头删 尾删 头删 (7)指定位置插入元素 (8)删除指定位置元素 (9)查找指定元素位置 (10)修改指定位置元素 完整版…

【21】c++设计模式——>装饰模式

装饰模式的定义 装饰模式也可以称为封装模式&#xff0c;所谓的封装就是在原有行为之上进行扩展&#xff0c;并不会改变该行为&#xff1b; 例如网络通信&#xff1a; 在进行网络通信的时候&#xff0c;数据是基于IOS七层或四层网络模型&#xff08;某些层合并之后就是四层模型…

Mongodb----部署副本集 实现读写分离

使用软件&#xff1a; xshell7 vmware16 centos8 nosql booster 1 部署副本集 推荐方案&#xff1a; 为了降低资源分配&#xff0c;这里仅使用一台服务器&#xff0c;但是分配3个端口&#xff08;27017、27018、27019&#xff09;来分别实现 主节点、副本节点…

35道Rust面试题

这套Rust面试题包括了填空题、判断题、连线题和编码题等题型。 选择题 1 &#xff0c;下面哪个是打印变量language的正确方法&#xff1f; A&#xff0c;println("{}", language); B&#xff0c;println(language); C&#xff0c;println!("{}", langu…

接口自动化测试 —— 协议、请求流程

一、架构 CRM客户关系管理系统 SAAS Software As A Service 软件即服务 PAAS Platform AS A Service 平台即服务 快速交付→ 快&#xff1a;自己去干、有结果、事事有回音、持续改进 单体架构——》垂直架构——》面向服务架构——》微服务架构&#xff08;分布式&#xf…

轻量限制流量?阿里云轻量应用服务器月流量包收费说明

阿里云轻量应用服务器部分套餐限制月流量&#xff0c;轻量应用服务器按照套餐售卖&#xff0c;有的套餐限制月流量&#xff0c;有的不限制流量。像阿里云轻量2核2G3M带宽轻量服务器一年108元和轻量2核4G4M带宽一年297.98元12个月&#xff0c;这两款是不限制月流量的。阿里云百科…

解析项目管理任务跟踪器,助力项目进展掌握!

什么是项目管理任务跟踪器&#xff1f;项目管理任务跟踪器是项目经理简化计划、组织和执行项目任务直至完成的重要工具。该工具可帮助他们掌握需要完成的工作、确定收到的工作请求的优先级、完成项目并在预算范围内按时实现目标。 除了布置和跟踪任务之外&#xff0c;项目管理任…

通过Node.js获取高德的省市区数据并插入数据库

通过Node.js获取高德的省市区数据并插入数据库 1 创建秘钥1.1 登录高德地图开放平台1.2 创建应用1.3 绑定服务创建秘钥 2 获取数据并插入2.1 创建数据库连接工具2.2 请求数据2.3 数据处理2.4 全部代码 3 还可以打印文件到本地 1 创建秘钥 1.1 登录高德地图开放平台 打开开放平…

rv1126-rknpu-v1.7.3添加opencv库

rv1126所使用的rknn sdk里默认是不带opencv库的&#xff0c;官方所用的例程里也没有使用opencv&#xff0c;但是这样在进行图像处理的时候有点麻烦了&#xff0c;这里有两种办法: 一是先用python将所需要的图片处理好后在转化为bin格式文件&#xff0c;在使用c或c进行读取&…

【大数据 | 综合实践】大数据技术基础综合项目 - 基于GitHub API的数据采集与分析平台

&#x1f935;‍♂️ 个人主页: AI_magician &#x1f4e1;主页地址&#xff1a; 作者简介&#xff1a;CSDN内容合伙人&#xff0c;全栈领域优质创作者。 &#x1f468;‍&#x1f4bb;景愿&#xff1a;旨在于能和更多的热爱计算机的伙伴一起成长&#xff01;&#xff01;&…