目的
记录这篇博客的目的是,平时经常在这两种语法之间经常切换。其中一个语法太久没写就导致就算是很简单的东西都要搜索怎么解决,所以写下这篇博客,需要用到的时候就可以快速找到。
Unity中ScrollView不能拖动到底部
content添加contentSizeFitter,选择PerferredSize即可解决问题。
csv导出中文乱码
在Excel中导出时工具选择Web选项–编码–UTF-8,再以记事本打开。另存为选择UTF-8。此时即可显示中文。如果在Excel中打开乱码,那再切换会原来的编码即可。
C#判断是否是数字
bool IsNumber = int.TryParse("asd", out int a);
Unity中颜色使用
gridBg.color = new Color32(189, 250, 129, 255)
Unity中修改RectTransform的left,right,top,bottom
offsetMin : 对应Left、Top
offsetMax : 对应Right、Bottom
RectTransform newUIRect = newUI.GetComponent<RectTransform>();
newUIRect.offsetMax = new Vector2(0, 0);
newUIRect.offsetMin = new Vector2(0, 0);
Unity中判断节点是否在范围内
//ballParentCollider是Collider类型
Vector3 pos = GetFirstOrLastLineGrid(false).transform.position;
bool rendererIsInsideTheBox = ballParentCollider.bounds.Contains(pos);