- 博客(7)
- 收藏
- 关注
原创 git报错显示被占用Another git process semms to be running in this repository
Another git process semms to be running in this repository, e.g. an editor opened by ‘git commit’. Please make sure all processes are terminated then try again. If it still fails, a git process remove the file manually to continue…起因:事情的起因是我个人的问题,推送到一半的时候
2020-11-30 09:41:03 290
原创 通过反射找到指定类中的静态方法,并传递参数进行调用
MethodInfo mi = typeof(MsgHandler).GetMethod(proto.ToString());//搜索指定类中具有指定名称的公共方法object[] o = { clientSocket, msgBase };//构建参数列表if (mi != null){ mi.Invoke(null,o); //函数执行,静态方法不需要创建实例,所以第一个参数为null}...
2020-07-30 00:45:36 510
原创 The type or namespace name ‘MenuItemAttribute‘ could not be found类似报错处理方法
类似报错主要是使用了UnityEditor相关的API,解决方法的话,只要将相关脚本放进Asset下的Editor文件夹之中即可。否则在打包的时候还可能会发生类似的报错
2020-07-21 18:57:29 4896 5
原创 LinQ学习记录(一)
1.from 子句 int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 }; var lowNums = from num in numbers where num < 5 select num; foreach (int i in lowNums) { Console.Write(i + " ");
2020-07-20 18:06:11 127
原创 vs快捷键:ctor+双击Tab,快速生成构造函数
public class NewBehaviourScript : MonoBehaviour{ public NewBehaviourScript() { //输入ctor+双击tab键,快速生成构造函数 }}
2020-07-18 15:31:43 1885
原创 unity性能优化:字符串操作(一)
一:避免额外的装箱操作 void example() { //1. string str1 = "my_num:" + 10086; //2. string str2= "my_num:" + 10086.ToString(); ///尽量选择第二种方法来凭借字符串,减少额外的消耗 /// 以第一种方法拼接字符串时,会产生额外的装箱行为, /// 而第二种调用的是整型中的tostrin
2020-07-18 15:07:59 1811
原创 在canvas初始化的时候设置渲染模式为ScreenSpaceCamera,并指定摄像机
using System.Collections;using System.Collections.Generic;using UnityEngine;public class CanvasInit : MonoBehaviour{ private void Awake() { Canvas thiscanvas = GetComponent<Canvas>(); thiscanvas.renderMode=RenderMode.Scr
2020-07-08 21:05:08 1178 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人