Hello,
I have a source base in C++ and was wondering if it were possible to get it delivered, via web, using Unity ?
I have read that it isn’t, but then seen others talking about Lua.
Is it possible to write a managed c# wrapper, which loads in an unmanaged C++ dll and then runs the code that way ?
Or how about compiling the C++ as managed and then delivering via unity ?
Thanks for any advice
You can not use any unmanaged code with the webplayer.
Actually you can not even use all .NET code with the webplayer as different things are disabled for security reasons (file io, process access, …)
We’ve done some really strange hacks with Java Applets, where we manage to load native code packages (actually developed in assembly language, but I suppose c++ could be made to work too)…
There doesn’t seem to be anything similar in the C# world since the closest thing to a C# plugin is Silverlight (:puke emoticon could not be found), which is very limited with regards to the .NET framework it uses.
If you can get the C++ code to compile as pure managed code, then yes. But that is probably more work than it may sound like, depending on what kind of library you have.
So why CAN’T you run c++ ? How is it different to managed C# code ? Is it the pointers it doesn’t like.
I am very interested in using Unity but can’t see why it’s impossible to run code. Is it something that the Unity guys are worried about and have disabled ?
Also, if there is no file IO then how do you load assets ?
Sorry for all of the questions, but with only 1 month trial it’s hard to get all answers to the questions I need =D
Because C++ is not managed, that simple it is.
Within the webplayer you can only run .NET code that meets the security requirements, nothing else (especially no local file access etc).
C++ code / dll - dylib plugins in general can only be used with the Pro generated standalones.
As for loading assets: by having them in the project already, through asset bundles or through the WWW Class.
Also, since today, there is no trial for Unity Indie anymore. Unity Indie is gone, long live unity, which is free.
So if your target is webplayer, then you can actually do it all without any trial fear in your back as the .NET extension capabilities are available to all (as non-pro you just lack the streamed webplayer and asset bundle functionality)