Hi,
Im only starting with Unity, so dont bash me please, but Im lost in the docs/tuts and cant seem to find the answers:
I need to convert my game from C++/DirectX to Unity so that I can deploy it to web (that`s my primary reason for choosing Unity).
This means that I want just to import the levels - i.e. avoid using the Unity 3D efitor as much as possible.
Is that possible ?
Also, I have the whole gameplay AI coded. Is it possbile to use this code or do I need to re-link / plac all objects in the Unity 3D Editor for each level ?
Ideally, I would just use Unity as an API without using the 3D Editor at all - I just need its ability to deploy the game to web.
Thanks for any ideas.
Within reason, everything is possible. The question is how hard it is.
We can’t actually give you much good advice without knowing what formats your art is in, level format (custom?) and so on.
You will likely need to do some manual editing in the Editor to set up materials and shaders, but you can automate a lot of that if you really want to.
My recommendation is to re-do it in the Unity editor. It’s never a good idea to shoehorn assets and code made for another engine - it usually ends in tears and you re-doing it manually anyway. Plus you will want to reduce the file size as much as possible for the web.
As for your code, it’s generally quite trivial to port C++ code to C# if you know both well, and if your C++ code is not too … odd. 
The Unity docs and MSDN’s / Mono’s .NET docs should help you with the rest.
Good luck,
-Jeremy
Using the unity editor is not really necessary. If you wanted to just import your entire level using Instantiate, you could certainly do that. However, using the editor to position static objects has so many advantages, you’d be doing yourself a disservice if you avoided it. If you’ve already got your levels figured out and know the XYZ, go ahead and come up with your own scene format and file. What about using the scene hierarchy for managing objects and scripts, are you going to avoid attaching scripts to objects as part of the scene? and attach them dynamically in code? Do you plan on just making everything a prefab? Sometimes it fits the pattern to dynamically attach a script to a game object, but typically not the norm.
You can do everything dynamically via code, but I would really take a step back, and follow a tutorial or two. Make a really simple demo. There are a lot of abilities and features that unity has that can be a great benefit to you, and it’ll be good to get in that frame of mind.
As far as rewriting your code. It depends. The logic can stay the same, but you will need to convert the language, obviously. In theory, it should be a rather straightforward process to port it over.
Also worth noting… the Pro version of Unity allows you to use functions written in C/C++ defined in a DLL. Any of your existing code that is not especially platform-dependent might be reusable like this (your AI code might be a good candidate).
But it is for a web player deploy…
OK, you win this time, Charles… 