Beispiel #1
0
    public void LoadPocketsFromTxt()
    {
        for (int i = 0; i < currencies.Count; i++)
        {
            if (currencies[i] == null)
            {
                continue;
            }

            Pocket tempPocket = currencyPockets[currencies[i]];
            Pocket newPocket;
            try
            {
                newPocket = SaveAndLoad.LoadFromTxt <Pocket>(currencies[i].name + ".txt");
            }
            catch (Exception e)
            {
                Debug.LogError(e.Message);
                newPocket = tempPocket;
            }

            if (newPocket != null)
            {
                currencyPockets[currencies[i]] = newPocket;
                onValueChange.Invoke(currencies[i], newPocket.Value);
            }
        }
    }