Ejemplo n.º 1
0
        void Load()
        {
            Dictionary <int, Item> _items = PersistentCache.TryLoad <Dictionary <int, Item> >();

            if (_items == null)
            {
                return;
            }
            foreach (var item in _items)
            {
                try
                {
                    Items[item.Key].IsBuy      = item.Value.IsBuy;
                    Items[item.Key].IsSelected = item.Value.IsSelected;
                }
                catch (KeyNotFoundException)
                {
                    Item _item = new Item()
                    {
                        ID = item.Key, IsBuy = item.Value.IsBuy, IsSelected = item.Value.IsSelected
                    };
                    Items.Add(item.Key, _item);
                }
                catch (Exception ex)
                {
                    Debug.LogWarning(ex);
                }
            }
        }
Ejemplo n.º 2
0
 void Load()
 {
     Data = PersistentCache.TryLoad <GameData>();
     if (Data == null)
     {
         Debug.Log("Data load unsuccessful");
         Data = new GameData();
     }
     SetControll(Data.InputType);
 }
Ejemplo n.º 3
0
 public void Load()
 {
     Model = PersistentCache.TryLoad <StartSettings>("model");
     if (Model == null)
     {
         Model = new StartSettings();
     }
     GravityInputField.text  = Model.BallGravity.ToString();
     SpeedInputField.text    = Model.BallSpeed.ToString();
     CamStartSpeed.text      = Model.CamStartSpeed.ToString();
     CamSpeedMultiplier.text = Model.CamSpeedMultiplier.ToString();
     CamMaxSpeed.text        = Model.CamMaxSpeed.ToString();
 }