Unity Bug记录本
//个人记录,持续更新
1、将此代码挂载到空脚本上:
bool flag = (object)GetComponent<Camera>() == null;
bool flag1 = (object)GetComponent<Text>() == null;
Debug.Log(flag+"::"+flag1);
//输出结果:False::True
bool flag = GetComponent<Camera>() == null;
bool flag1 = GetComponent<Text>() == null;
Debug.Log(flag+"::"+flag1);
//输出结果:True::True
原因:Unity C#7.0会出现此问题,似乎是因为unity底层重写了一些标识符