Пример #1
0
 /* Action with a plane skin, select or buy
  */
 public void PlanesAction(string name)
 {
     if (PlayerPrefs.GetInt("planes_" + name) > 0)
     {
         gm.player.GetComponent <DeltaCosmetic>().ChangePlane(name);
         playerShop.ChangePlane(name);
         PlayerPrefs.SetString("actual_plane", name);
         PlayerPrefs.Save();
     }
     else
     {
         int price = GetPlanePrice(name);
         if (price > -1 && gm.Buy(price))
         {
             PlayerPrefs.SetInt("planes_" + name, 1);
             PlayerPrefs.SetString("actual_plane", name);
             gm.player.GetComponent <DeltaCosmetic>().ChangePlane(name);
             playerShop.ChangePlane(name);
             PlayerPrefs.Save();
             RefreshShop();
         }
     }
 }