Exemplo n.º 1
0
    private Ammo GetAmmoWithId(int id)
    {
        for (int i = 0; i < SelectedAmmo.Count; i++)
        {
            if (SelectedAmmo[i].Id == id)
            {
                return(SelectedAmmo[i]);
            }
        }
        Ammo ammoDB = StaticTagFinder.GameManager.GetAmmoByID(id);

        if (ammoDB != null)
        {
            ammoDB            = ammoDB.CloneAmmo();
            ammoDB.SetForGame = false;
            SelectedAmmo.Add(ammoDB);
            return(ammoDB);
        }
        Debug.LogWarning("Can't find ammo in player selects with id " + id);
        return(null);
    }