简体   繁体   English

当我尝试构建我的项目时,Unity 给我错误

[英]Unity giving me errors when i try to build my project

i have tried to build my project in Unity.我试图在 Unity 中构建我的项目。 but, i got a lot off error.但是,我有很多错误。 iam a newbie.我是新手。 here's my error's这是我的错误

Thank You谢谢你

Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(9,30): error CS0115: 'PlayAudioClipEditor.OnInspectorGUI()': no suitable method found to override Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(9,30): error CS0115: 'PlayAudioClipEditor.OnInspectorGUI()': 找不到合适的方法来覆盖

Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(7,40): error CS0246: The type or namespace name 'Editor' could not be found (are you missing a using directive or an assembly reference?) Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(7,40):错误 CS0246:找不到类型或命名空间名称“Editor”(是否缺少 using 指令或程序集引用?)

Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(5,6): error CS0246: The type or namespace name 'CustomEditorAttribute' could not be found (are you missing a using directive or an assembly reference?) Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(5,6):错误 CS0246:找不到类型或命名空间名称“CustomEditorAttribute”(是否缺少 using 指令或程序集引用?)

Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(5,6): error CS0246: The type or namespace name 'CustomEditor' could not be found (are you missing a using directive or an assembly reference?) Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(5,6):错误 CS0246:找不到类型或命名空间名称“CustomEditor”(是否缺少 using 指令或程序集引用?)

Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(6,6): error CS0246: The type or namespace name 'CanEditMultipleObjectsAttribute' could not be found (are you missing a using directive or an assembly reference?) Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(6,6):错误 CS0246:找不到类型或命名空间名称“CanEditMultipleObjectsAttribute”(是否缺少 using 指令或程序集引用?)

Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(6,6): error CS0246: The type or namespace name 'CanEditMultipleObjects' could not be found (are you missing a using directive or an assembly reference?) Assets\BrightAnimator\Runtime\Editor\PlayAudioClipEditor.cs(6,6):错误 CS0246:找不到类型或命名空间名称“CanEditMultipleObjects”(是否缺少 using 指令或程序集引用?)

Error building Player because scripts had compiler errors构建 Player 时出错,因为脚本有编译器错误

Build completed with a result of 'Failed' in 7 seconds (6799 ms) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)构建在 7 秒(6799 毫秒)内完成,结果为“失败” UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

UnityEditor.BuildPlayerWindow+BuildMethodException: 7 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <5ad584e208e14caaa9e6b2e6027e9204>:0 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <5ad584e208e14caaa9e6b2e6027e9204>:0 UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) UnityEditor.BuildPlayerWindow+BuildMethodException: 7 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <5ad584e208e14caaa9e6b2e6027e9204>:0 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080 ] 在 <5ad584e208e14caaa9e6b2e6027e9204>:0 UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

You are using UnityEditor code which is causing these errors.您正在使用导致这些错误的UnityEditor代码。 To fix this, you have to add #if UNITY_EDTIOR and #endif on top and bottom of each editor script respectively.要解决此问题,您必须分别在每个编辑器脚本的顶部和底部添加#if UNITY_EDTIOR#endif

Example例子

#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;

public class MyClass: Editor
{
    // Your code
}
#endif

An alternative to the #if UNITY_EDITOR solution is to place an assembly definition file into (each of) your Editor folders, and enable ONLY the Editor platform in it. #if UNITY_EDITOR解决方案的替代方法是将程序集定义文件放入(每个) Editor文件夹中,并仅在其中启用编辑器平台。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我尝试构建我的项目时,Unity 出现奇怪的错误 - Unity gives strange errors when i try to build my project 我正在尝试统一构建游戏,但这给了我一个错误 - I am trying to build my game in unity but it is giving me an error Unity 5不断给我错误 - Unity 5 keeps giving me errors 当我尝试将枚举格式化为字符串时,为什么我的格式会给我一个错误? - Why is my format giving me an error when I try to format an enum to a string? 我的 Unity 项目包含阻止我进入播放模式的空编译器错误。 我如何解决它们?<Solved> - My Unity project contains empty compiler errors that stop me from entering play mode. How do I resolve them? <Solved> Unity c# null 在我尝试访问实体组件数据时构建到我的 Iphone 时出现参考错误 - Unity c# null reference error when I build to my Iphone when I try to access an entities component data 我正在统一执行库存系统,但它给了我这些错误。 我应该怎么办? - I am doing Inventory system in unity but its giving me these errors. What should i do? 当我尝试在 Unity 中构建我的 2D 项目时出现错误 CS0234 - I've got error CS0234 when I tried to build my 2D project in Unity 为什么在我构建项目时Visual Studio没有在Test Explorer中给我测试? - Why Does Visual Studio not give me a test in Test explorer when I build my project? 我无法将我的统一项目构建成 apk - I'm not able to build my unity project into apk
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM