每次我尝试向任何预制件添加新脚本即时消息
“由于找不到脚本类而无法添加脚本组件。确保没有编译错误”
是的,文件名匹配。
我正在使用最新版本的当前版本2018.3.5f1
我最近使用的是here中的“ Unity C#5.0和6.0集成” 因为我在控制台中遇到这种错误
“错误CS1644:无法使用,因为它不是C#4.0语言规范的一部分。”
那之后,不知道如何卸载它,我删除了文件夹并重新导入了资产
现在我遇到这个错误,据推测导致我添加了脚本组件
UnityEditor.Scripting.Compilers.ScriptCompilerBase.BeginCompiling()(在C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:60) UnityEditor.Scripting.ScriptCompilation.CompilationTask.QueuePendingAssemblies()(在C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationTask.cs:228) UnityEditor.Scripting.ScriptCompilation.CompilationTask.Poll()(在C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationTask.cs:135) UnityEditor.Scripting.ScriptCompilation.EditorCompilation.CompileScriptAssemblies(UnityEditor.Scripting.ScriptCompilation.ScriptAsssembly [] scriptAssemblies,UnityEditor.Scripting.ScriptCompilation.ScriptAssemblySettings scriptAssemblySettings,System.String tempBuildDirectory,EditorScriptCompilationOption,ScriptCompilationOptions,脚本编译组件/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:1133) UnityEditor.Scripting.ScriptCompilation.EditorCompilation.CompileCustomScriptAssemblies(UnityEditor.Scripting.ScriptCompilation.ScriptAssemblySettings scriptAssemblySettings,System.String tempBuildDirectory,EditorScriptCompilationOptions选项,BuildTargetGroup platformGroup,BuildTarget平台)(位于C:/ build / Buildslave ScriptCompilation / EditorCompilation.cs:1045) UnityEditor.Scripting.ScriptCompilation.EditorCompilation.CompileCustomScriptAssemblies(EditorScriptCompilationOptions选项,BuildTargetGroup platformGroup,BuildTarget平台)(位于C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:1039) UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface + c__AnonStorey4。<> m__0()(在C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:277) UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface.EmitExceptionAsError [Boolean](System.Func`1 func,Boolean returnValue)(在C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:97) UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:CompileCustomScriptAssemblies(EditorScriptCompilationOptions,BuildTargetGroup,BuildTarget)
有什么想法吗?
答案 0 :(得分:0)
我必须导出我的资产包
重新安装统一
创建新项目文件夹
然后导入资产,错误消失了,原来是我的文件夹有问题