Search Unity

Designing a shop and character customization (best practices)?

Discussion in 'Scripting' started by echoic, Aug 16, 2013.

  1. echoic

    echoic

    Joined:
    Apr 29, 2011
    Posts:
    91
    My new iOS title has an in game shop containing dozens (and soon hundreds) of items which can be worn by the player's character. My current method of adding a new item to the game is somewhat tedious, as I'm just running a ton of if statements in my equipper script that swaps textures and/or turns bones on or off.
    e.g. : equipping "black top hat" would:
    -unhide hat bone
    -swap default hat bone texture to black top hat
    -hide bowler hat
    -hide halo
    -hide hair clip
    -hide demon horns
    -etc
    -etc
    .............you get the idea. It becomes very tedious, because each new item i add requires editing a ton of ifs (one for each item).

    Anyone here with experience implementing character customization got any pointers? Thanks in advance!
     
  2. GuitarJonas

    GuitarJonas

    Joined:
    Sep 28, 2011
    Posts:
    226
    Hello.
    For me to be able to help you i need to know some stuff.
    Can you tell me, how you handle equipping hats in-game? -Do you have an Inventory, which lets you equip and store items like in any rpg, or how is it?

    Jonas