/// <summary>
    /// Awake is called when the script instance is being loaded.
    /// </summary>
    void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Destroy(gameObject);
        }
        else
        {
            Instance = this;
        }
        weaponStats = Resources.Load <WeaponStatsSO>("ScriptableObjects/WeaponStats");

        Weapons = new List <RangedWeapon>();
        Object[] objects = Resources.LoadAll("Weapons");

        foreach (Object obj in objects)
        {
            GameObject weapon = (GameObject)obj;
            weapon = Instantiate(weapon);
            weapon.transform.position = transform.position;
            weapon.transform.SetParent(this.transform);
            weapon.SetActive(false);
            RangedWeapon      rangedWeapon = weapon.GetComponent <RangedWeapon>();
            RangedWeaponStats stats        = new RangedWeaponStats();
            foreach (RangedWeaponStats s in weaponStats.stats)
            {
                if (s.name == rangedWeapon.GetType().Name)
                {
                    stats = s;
                    break;
                }
            }
            rangedWeapon.stats = stats;
            rangedWeapon.CalculateUpgradeCost();
            Weapons.Add(rangedWeapon);
        }
        //have to subtract 1 since pistol is not part of drops
        weaponDrops = new string[Weapons.Count - 1];

        int weaponIndex = 0;
        int dropIndex   = 0;

        while (weaponIndex < Weapons.Count)
        {
            RangedWeapon weapon = Weapons[weaponIndex];
            if (weapon.GetType() == typeof(Pistol))
            {
                weaponIndex++;
            }
            else
            {
                weaponDrops[dropIndex] = weapon.GetType().Name + "Drop";
                weaponIndex++;
                dropIndex++;
            }
        }
    }