Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Dressup Game Help

Discussion in 'Editor & General Support' started by Shukerullah, Dec 5, 2014.

  1. Shukerullah

    Shukerullah

    Joined:
    Mar 15, 2013
    Posts:
    97
    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:
    Code (CSharp):
    1. public UITexture[] shirs;
    2.  
    3. void NextShirt() {
    4. characterShirt.mainTexture = shirs[index];
    5. }
    6.  
    7. // OR
    8.  
    9. void NextShirt() {
    10. characterShirt.mainTexture = Resources.Load("Shirt1") as  Texture;
    11. }
    Which of method will you recommend? and which method is better in term of performance?

    Thanks
     
  2. Rasmus Selsmark

    Rasmus Selsmark

    Joined:
    Mar 13, 2013
    Posts:
    120
    Shukerullah likes this.
  3. Shukerullah

    Shukerullah

    Joined:
    Mar 15, 2013
    Posts:
    97