C#

GameObject & components (Unity)

Në shqip: GameObject-et dhe komponentët

ShpjegimiSQ

Në Unity, çdo gjë në skenë është një GameObject — lojtari, topi, kamera. Ai vetë s'bën asgjë; aftësitë ia japin komponentët: Transform (pozicioni), Rigidbody (fizika), Collider (përplasjet) dhe skriptet e tua.

EnglishEN

In Unity, everything in the scene is a GameObject — the player, the ball, the camera. On its own it does nothing; components give it abilities: Transform (position), Rigidbody (physics), Collider (collisions) and your scripts.

Si ta mendosh

Si një kukull Lego: trupi është GameObject-i, dhe ia shton kapelën, çantën ose shpatën si komponentë.

Lexoje në anglisht

Like a Lego minifigure: the body is the GameObject, and you add the hat, bag or sword as components.

Shembull kodicsharp

var rb = GetComponent<Rigidbody>();
rb.AddForce(Vector3.up * 5, ForceMode.Impulse);   // kërce!

Terma të lidhur