I want to know if i can create an unrenderable class
to manage the gamelogic (and Obviously this class needs Update()) or is it the gameobjects themselves that have do this tasks (beurk!.. )?
(By the way to create one i use Destroy(transform) in Start() function to make sure i can’t render it))
Because if we create a gamelogic class we will have to manage classes from scripts that are not attached to this gamelogic object, i heard we can’t.
I script in C#.I hope Unity will implement C++ scripting,that’s the real OOP power :twisted:
C#, Boo and probably Javascript (though I don’t know it too well) are just as OOP-able as C++ for what you’ll need.
As far as your question goes, what you’re asking is pretty common. Generally you’ll create an empty Game Object in your scene and add your game logic scripts to it. In my project I have one for my core game logic and one for my user interface scripts.
What may be taking you aback is the having to create MonoBehaviour objects but you only need those for classes you’re going to add to those GameObjects. So you’re main “GameWorld” type class you’ll want but then plenty of other classes can be normal class with any class hierarchy you want, that your GameWorld/Logic classes manage.
It does take a little tweaking of your thought if you’re used to straight code but once you get it, it’s not that different (think of GameObjects as holders for your classes, etc or namespaces).
If you want the object not to render, simply create an empty game object and attach your script to it. If there’s no mesh renderer component attached, there’s nothing to render.
Thx guys it’s only been a week with Unity3D and C#, i am used to Ogre3D and C++, i even participated in building a rendering engine, so i was a littlebit lost (no constructors and more…).