如何编译 Unity3D 脚本以将其包含到 AssetBundle 中? [英] How to compile Unity3D script to include it to AssetBundle?

查看:44
本文介绍了如何编译 Unity3D 脚本以将其包含到 AssetBundle 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据此手册,我可以将脚本作为二进制数据包含并通过反射加载它们.我了解所有步骤,除了一个:如何编译脚本以获取二进制数据以将其存储在 .binary 文件中?有任何教程/帮助吗?

According to this manual I can include scripts as binary data and load them via Reflection. I understand all steps, except one: how can I compile script to get binary data for stroring it in .binary file? Is there any tutorial/help?

UPD:实际问题可以重申为:如何使用 MonoDevelop 编译单个文件并获取其字节码"

UPD: Actual question can be restated as: "How can I compile single file with MonoDevelop and get its bytecode"

推荐答案

解决方案:

  1. 打开 Monodevelop 并创建 C#Library 项目
  2. 将 UnityEngine.dll 添加到引用
  3. 编译你的脚本
  4. 将库项目文件夹中的 bin/.dll 复制到统一项目的 Assets 并将扩展名从 .dll 更改为 .bytes

仅此而已.

这篇关于如何编译 Unity3D 脚本以将其包含到 AssetBundle 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆