Prefabs (Unity)
Në shqip përdoret i njëjti emër.
ShpjegimiSQ
Një prefab është një GameObject i ruajtur si shabllon — p.sh. një armik ose një monedhë. Me Instantiate() krijon sa kopje të duash gjatë lojës, dhe po ndryshove prefab-in, ndryshojnë të gjitha.
EnglishEN
A prefab is a GameObject saved as a template — like an enemy or a coin. With Instantiate() you create as many copies as you like during the game, and if you change the prefab, they all change.
Si ta mendosh
Si kallëpi i biskotave: një kallëp, sa biskota të duash.
Lexoje në anglisht
Like a cookie cutter: one cutter, as many cookies as you want.
Shembull kodicsharp
public GameObject monedhaPrefab;
void Start() {
for (int i = 0; i < 10; i++)
Instantiate(monedhaPrefab, new Vector3(i * 2, 1, 0), Quaternion.identity);
}