2

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: Actual question can be restated as: "How can I compile single file with MonoDevelop and get its bytecode"

Vitaly S.
  • 2,389
  • 26
  • 40
  • I've asked this in both places. There is [unity3d] tag, so some people can help me. If I'll find answer myself, I'm going to post it here to help google index this question. – Vitaly S. May 29 '12 at 23:21
  • From the link you provided: `You can create your assemblies in any normal C# IDE (e.g. Monodevelop, Visual Studio) or any text editor using the mono/.net compilers.` – jahroy May 29 '12 at 23:22
  • I've updated the question. Actually I can't find how to compile single file with monodevelop and get its bytecode – Vitaly S. May 29 '12 at 23:37
  • Now that should be a question that somebody can answer. I've never used MonoDevelop, but I get this after a quick google: `http://www.mono-project.com/CSharp_Compiler` – jahroy May 30 '12 at 00:23

1 Answers1

4

Solution:

  1. Open Monodevelop and create C#Library project
  2. Add UnityEngine.dll to References
  3. Compile your scripts
  4. Copy bin/.dll from your library project folder to Assets of your unity project and change extension from .dll to .bytes

That's all.

Vitaly S.
  • 2,389
  • 26
  • 40