Moving from XNA

I’ve been looking up all the differences between XNA and Unity3d. I’ve figured out the easy ones like input, vector2, etc. My issue is I’m not finding something similar to Spritbatch. So like in xna you would call spritebatch.draw() to draw your 2d object. Could someone point me in the right direction?

I have a 2d framework in xna for a 2D game that I would like to bring over to Unity to continue my game. I’m not looking to spend money on frameworks already made for 2D games. I have my own and would to figure out the drawing part. As for most of it is just C# code except for the drawing and some other pieces of the code.

I first came to Unity from the Python PyGame module, OpenGL Glut, and C++ Allegro. These are all libraries in which you are responsible for drawing things directly to buffers as and when you need them.

Unity is completely opposite to this. In Unity you create your visual assets and instantiate them. You attach your behaviour functionalities as children (components) to these instances.

My first year or so with Unity was pretty tough as I was trying to force Unity to behave like these other engines, when Unity has it’s very own paradigms.

I’d reccomend getting familiar with the relationship of GameObject and Component.

From Xna lifecycle, Init/LoadContent could be assimilated to Awake/Start (Start is only call when the object is activated), Update is Update, UnloadContent is OnDestroy.

Draw would be LateUpdate as for when it happens but the purpose is not the same. Unity hides the rendering process while XNA still requires the call to send to the GPU. Forget about it here.

Note Unity has many more callbacks, I guess XNA had also but those are the main ones.

Also, XNA used virtual and override while Unity uses reflection to call a callback method from the lifecycle. Hence the absence of override on the front and no base.Method().