我只想实现一个简单的IPreprocessBuildWithReport
来编写一个.csv文件.
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()
{
...
}
}
}
骑手很乐意照顾我,但联合拒绝建造,坚持认为
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
发布于 2022-01-27 09:20:11
您需要将编辑器脚本放入名为" editor“=的文件夹中。
您的脚本在编辑器环境中编译和运行。在构建可执行应用程序时,编辑器会找到并执行特定的方法。但是由于它是一个编辑器脚本,而不是一个生产脚本,它需要被团结承认为扩展编辑器的一部分,而不是你的应用程序的一部分。
统一并不总是直观的,但它确实爱你。
https://stackoverflow.com/questions/70870697
复制相似问题