Exemplo n.º 1
0
        private void LoadItems()
        {
            if (items != null && items.Count > 0)
            {
                for (int i = 0; i < items.Count; i++)
                {
                    Item      item      = items[i];
                    SavedItem savedItem = BinaryPrefs.GetClass <SavedItem>(item.id.ToString());
                    if (savedItem != null)
                    {
                        items[i].LoadFrom(savedItem);
                    }
                }
            }
            else
            {
                Debug.LogWarning("There is no item in your game ! Please verify that everything is setup correctly", this);
            }

            LoadPack();

            if (!IsInitialized)
            {
                IsInitialized = true;
                onInitializeSuccess?.Invoke();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Load the previously saved payment
        /// </summary>
        public void LoadPayment()
        {
            SavedPayment savedPayment = BinaryPrefs.GetClass <SavedPayment>(payment.id);

            if (savedPayment != null)
            {
                payment.LoadFrom(savedPayment);
            }
        }
Exemplo n.º 3
0
    private void LoadSeeds()
    {
        List <string> ids = new List <string>();

        ids = BinaryPrefs.GetClass <List <String> >(SeedString);

        ids = BinaryPrefs.GetClass <List <String> >(ViewSeedString);
        if (ids != null && ids.Count > 0)
        {
            foreach (var s in ids)
            {
                _viewedSeeds.Add(_seedLibrary.FirstOrDefault <Seed>(u => u._id == s));
            }
        }
    }
Exemplo n.º 4
0
        private void LoadPack()
        {
            if (packs != null && packs.Count > 0)
            {
                for (int i = 0; i < packs.Count; i++)
                {
                    Pack      pack      = packs[i];
                    SavedPack savedPack = BinaryPrefs.GetClass <SavedPack>(pack.id.ToString());
                    if (savedPack != null)
                    {
                        packs[i].LoadFrom(savedPack);
                    }

                    pack.onCollectSuccessful += OnPackCollectSuccessfulInvoker;
                    pack.onCollectFailed     += OnPackCollectFailedInvoker;
                }
            }
            else
            {
                Debug.LogWarning("There is no pack in your game ! Please verify that everything is setup correctly", this);
            }
        }