@preacherX:
Originally Posted By: preacherX
[...]
For example, I just spoke with someone who is studying Game Design with Unity and asked him how I can create a sprite in Unity with code:

The code would be something like this:

Vector3 rndPos = new Vector3(10.0f,10.0f,10.0f);
GameObject Go = new GameObject();
Go.transform.position = rndPos;
Go.transform.localScale *= 10.0f;
Go.transform.rotation = Quaternion.Euler(0, 0, 10.0f);
SpriteRenderer renderer = Go.AddComponent<SpriteRenderer>();
Sprite tmp = Resources.Load<Sprite>("Stein");
renderer.sprite = tmp;

In lite_C I would just use this:

ENTITY* Go=ent_create("Stein.png",vector(1,1,1),StoneBehaviour);
Go.roll=10;vec_fill(Go.scale_x,1);

Or does someone know if there is an easier way to do this in Unity?

I Mostly agree with Sid.
Plus, the difference between those two code examples is that the lite-c code has the position cramped into the .._create-line. Other than that, Acknex just hides a lot while (- from what I can see in the code snippet -) Unity offers you more possibilities here. The resource loading is most likely a lot better than Acknex's, too.

Ignoring all that, you could simply write a function for either engine and use it as a one-liner to create sprites. Yes, the additional freedom in Unity/Unreal also requires you to write a few more lines at the lower level, but once you have that intermediate layer of code working, this difference is not really a problem anymore. Honestly, I'd prefer it that way in acknex, too, because I regularly run into problems that the engine is making difficult or impossible to solve by obfuscating and hiding things in engine functions to "make things easier". Now, I don't wanna turn this into an "acknex is crap"-rant but I don't fully agree with your point.

(also, I don't wanna be nit-picky but there are pointer errors in your code that only work due to lite-c's automatic (de)referencing. I'd recommend anyone who uses Acknex to turn that off)


POTATO-MAN saves the day! - Random