Dressup Game Help

Hello All,
Im making 2D Dressup game with NGUI. Im using UITexture for character’s shirts, pent, shoes and hats. Character have alteast 10-20 textures for shirts and other cloths. Should I load all texture from Resource folder or should I make public Texture array?

Example:

public UITexture[] shirs;

void NextShirt() {
characterShirt.mainTexture = shirs[index];
}

// OR

void NextShirt() {
characterShirt.mainTexture = Resources.Load("Shirt1") as  Texture;
}

Which of method will you recommend? and which method is better in term of performance?

Thanks

I would say use object pooling in most situations, see e.g. http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/object-pooling or search for “unity object pool” using your favourite search machine

1 Like

Thanks sir