首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >缺少实现“`IPreprocessBuildWithReport`”的程序集引用?

缺少实现“`IPreprocessBuildWithReport`”的程序集引用?
EN

Stack Overflow用户
提问于 2022-01-26 21:49:01
回答 1查看 783关注 0票数 2

我只想实现一个简单的IPreprocessBuildWithReport来编写一个.csv文件.

代码语言:javascript
运行
复制
using System.IO;
using System.Text;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.Callbacks;

namespace My.App.Scripts
{
    public class MyStuffDoer : IPreprocessBuildWithReport
 
        public int callbackOrder => 0;
 
        public void OnPreprocessBuild(BuildReport report)
        {
            DoMyStuff();
        }
 
        [DidReloadScripts]
        public static void DoMyStuff()
        {
            ...
        }
    }
}

骑手很乐意照顾我,但联合拒绝建造,坚持认为

代码语言:javascript
运行
复制
The type or namespace 'Build' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
The type or namespace 'Callbacks' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
The type or namespace 'IPreprocessBuildWithReport' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace 'BuildReport' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace 'DidReloadScriptsAttribute' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace 'DidReloadScripts' could not be found (are you missing a using directive or an assembly reference?)

别问我,团结,我不知道!是吗?!

在互联网上似乎找不到任何对此有帮助的东西。

我发现的所有示例都只是将它们的IPreprocessBuildWithReport实现抛到我身上,完全没有提到程序集。

如何实现IPreprocessBuildWithReport

EN

Stack Overflow用户

回答已采纳

发布于 2022-01-27 09:20:11

您需要将编辑器脚本放入名为" editor“=的文件夹中。

您的脚本在编辑器环境中编译和运行。在构建可执行应用程序时,编辑器会找到并执行特定的方法。但是由于它是一个编辑器脚本,而不是一个生产脚本,它需要被团结承认为扩展编辑器的一部分,而不是你的应用程序的一部分。

统一并不总是直观的,但它确实爱你。

票数 3
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70870697

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档