简体   繁体   中英

Partially build Unity3D editor extensions

tl;dr: I need to make Unity compile my extension although compiler errors in other, non-Editor scripts exist.

I made a code generation extension for Unity3D. When depending on generated code without previously having these dependencies generated via the extension the compiler rightfully throws an error that some references are not found.

To fix the issue you would simply have to generate the code and all references will automatically be resolvable. However, because there are compilation issues, the extension itself is not built and as a result, is not generating the necessary files and thus leaving the system in a deadlock.

I tried to move my extension into Plugins/Editor/* to meet the multi-phase compilation requirements, however, it seems as if Unity does not honor the new folder structure and won't compile my extension and thus won't generate the necessary code.

Is there any workaround for this specific problem?

I finally figured out how to address the problem.

Move your code into a separate DLL and import it into a special folder such as Plugins/Editor .

Restart Unity. Restarting is important as Unity only seems to pick-up new plugins at start-up if compilation errors exist.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM