Page 1 of 1

Using Cobra in Unity ? Anyone ?

PostPosted: Mon Nov 24, 2014 1:23 pm
by AMIGrAve
Hi there,

I'd like to know if anyone tried/succeeded to use Cobra with Unity 3D ?

They are going to drop documentation support for Boo in version 5. IMHO Cobra is superior to Boo in many aspects and would be a nice fit for a Boo replacement so I wonder if anyone has already tried that path ?

Re: Using Cobra in Unity ? Anyone ?

PostPosted: Tue Nov 25, 2014 5:57 am
by nerdzero
Yep, I tried this last year but mostly as a proof of concept. I use C# when working in Unity. I don't have the actual code anymore, but from my notes here's a rough overview of what I did:

1. Reference UnityEngine.dll
2. Create a class that inherits from UnityEngine.MonoBehavior (put it in the global namespace)
3. Compile the dll using the -turbo Cobra compiler option.
4. Copy the dll to the Plugins folder in your project (create it if it doesn't exist)

The biggest downside is that you need to compile and copy the assembly when you change the code either manually or via a script. It won't work like with XS or VS where you just change the code, save, and then switch to Unity and see the changes.

Re: Using Cobra in Unity ? Anyone ?

PostPosted: Tue Nov 25, 2014 12:30 pm
by Charles
nerdzero wrote:The biggest downside is that you need to compile and copy the assembly when you change the code either manually or via a script. It won't work like with XS or VS where you just change the code, save, and then switch to Unity and see the changes.

Might they have hooks or be willing to add them to enable this? It might require contacting them.

Re: Using Cobra in Unity ? Anyone ?

PostPosted: Tue Nov 25, 2014 8:19 pm
by nerdzero
Probably. They run a custom version of MonoDevelop but I don't think it's that different from the vanilla version. The Unity forums might be a good place to start: http://forum.unity3d.com/ I would like to help but I don't have the time. I'm working furiously on my parser and am making good progress :)