[Unity][学习笔记]遇见的问题汇总

常见问题汇总

  • 脚本前的勾选框消失
  • Failed to load target on start
  • warning CS0108:'AAAA' hides inherited member 'BBBB'. Use the new keyword if hiding was intended
  • UnityEditor.BuildPlayerWindow+BuildMethodException

脚本前的勾选框消失

勾选框消失
解决办法:
在脚本中添加

void Start()
{
}

[Unity][学习笔记]遇见的问题汇总_第1张图片

Failed to load target on start

[Unity][学习笔记]遇见的问题汇总_第2张图片
原因:存放图片的路径无效
解决办法
在目录Assets下新建一个StreamingAssets的文件夹存放图片
看上图白色感叹号的地方,是路径应该长的样子,系统提示的啥样就改成啥样
[Unity][学习笔记]遇见的问题汇总_第3张图片

warning CS0108:‘AAAA’ hides inherited member ‘BBBB’. Use the new keyword if hiding was intended

原因:在脚本中定义的变量名称和unity自身的关键词重复,进而将其隐藏。

解决办法:
将与关键词冲突的变量改一个名称。
一般双击错误进去就能看见冲突的变量(打了波浪线)

UnityEditor.BuildPlayerWindow+BuildMethodException

错误:
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:182
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:89
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
在这里插入图片描述
解决办法:
【网上查阅尚未证实】貌似是unity版本的问题,换一个版本就好了

你可能感兴趣的:(学习笔记,unity)