Weapon Choosing

hi,

currently working on one game, in this what i want that player should choose his weapon before starting the level.

what i want, supposes when i start playing 1st level play has 2 weapons to control, if he win this level he will get enemy weapon also , but i want to show only 2 weapons when we’re playing the game, now before going in to the 2nd level we should chose 2 weapons from the list of 3 start the playing 2nd level,
So please can somebody help me on this…

thanks in advance for the help.

What you’'ll probably want is to keep all the information regarding a single weapon in a class:

public class Weapon {
  public string Name;
  public Texture Icon;
  public GameObject WeaponGO; // etc...
}

Then you should keep those inside generic lists (if in C#, if in Unityscript check the Unityscript language reference):

public List<Weapon> CarriedWeapons = new List<Weapon>();
public List<Weapon> CollectedWeapons = new List<Weapon>();

When the level starts, Clear() the CollectedWeapons list, and during the level Add() each collected weapon to the list.

At the end of the level you will have some items in CollectedWeapons list. You could now use that list to show a GUI dialog displaying the collected weapons using Name and Icons. Alow user to pick one of the CollectedWeapons (A). Then show the CarriedWeapons and alow user to click one of those (B). Remove() item (B) from CarriedWeapons. Add item (A) to CarriedWeapons.

Or something like that… :slight_smile: