{
"Debug.Log": { // 这里显示输出d给的代码提示窗口中的显示内容,附图在下
"prefix": "d", // 首先按下的键,拿这个举例则是输出一个d然后回车或者tab即出现Debug.Log();
"body": [
"Debug.Log($1);"
],
"description": "Log output to debug"
},
"if语句": {
"prefix": "if",
"body": [
"if($1) {",
" $2$0",
"}"
],
"description": "Output 'if'"
},
"for循环": {
"prefix": "for",
"body": [
"for (int i = 0; i < $1; i++) {",
" $2$0",
"}"
],
"description": "Output Loop 'fori'"
},
"foreach循环": {
"prefix": "fore",
"body": [
"foreach (var item in collection) {",
" $2$0",
"}"
],
"description": "Output Loop 'foreach'"
},
"switch": {
"prefix": "sw",
"body": [
"switch (switch_on) {",
" $2$0",
" default:",
" break;",
"}"
],
"description": "Output 'switch'"
},
"快捷创建方法": {
"prefix": "void",
"body": [
"void name() {",
" $2$0",
"}"
],
"description": "Output 'void'"
},
"快捷创建协程": {
"prefix": "ien",
"body": [
"IEnumerator name() {",
" yield return null;",
"}"
],
"description": "Output 'IEnumerator'"
},
"获取组件": {
"prefix": "gc",
"body": [
"GetComponent<$1>($2)",
],
"description": "Output 'GetComponent'"
},
"延迟条件等待": {
"prefix": "wait",
"body": [
"yield return new WaitUntil(() => $1);",
],
"description": "Output 'WaitUntil'"
},
"延迟时间等待": {
"prefix": "waitfor",
"body": [
"yield return new WaitForSeconds($1);",
],
"description": "Output 'WaitForSeconds'"
},
"创建字典": {
"prefix": "dic",
"body": [
"Dictionary<$1 , $2> dic = new Dictionary<$1 , $2>();",
],
"description": "Output 'Dictionary'"
},
"创建列表": {
"prefix": "list",
"body": [
"List<$1> list = new List<$1>();",
],
"description": "Output 'list'"
}
}
vscode代码片段记录 C#
最新推荐文章于 2024-04-15 10:36:54 发布