Forums

Using Cobra in Unity ? Anyone ?

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Using Cobra in Unity ? Anyone ?

Postby AMIGrAve » Mon Nov 24, 2014 1:23 pm

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 ?
AMIGrAve
 
Posts: 6

Re: Using Cobra in Unity ? Anyone ?

Postby nerdzero » Tue Nov 25, 2014 5:57 am

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.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Using Cobra in Unity ? Anyone ?

Postby Charles » Tue Nov 25, 2014 12:30 pm

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.
Charles
 
Posts: 2510
Location: Los Angeles, CA

Re: Using Cobra in Unity ? Anyone ?

Postby nerdzero » Tue Nov 25, 2014 8:19 pm

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 :)
nerdzero
 
Posts: 286
Location: Chicago, IL


Return to Discussion

Who is online

Users browsing this forum: No registered users and 10 guests

cron