void SaveCreatures() { SaveMainCampPonies(); Ini.AddHeader("OtherCreatures"); Ini.Set("UniSpawn_health", UniSpawn.health.ToString()); Ini.Set("Timber1_health", Timberwolf1.health.ToString()); Ini.Set("Timber2_health", Timberwolf2.health.ToString()); Ini.Set("Ursa_health", Ursa.health.ToString()); }
void SavePony(string PonyName, Creature Pony, bool saveTransform) { Ini.AddHeader(PonyName); Ini.Set(PonyName + "_health", Pony.health.ToString()); if (saveTransform) { Ini.Set(PonyName + "_x", Pony.transform.position.x.ToString()); Ini.Set(PonyName + "_y", Pony.transform.position.y.ToString()); Ini.Set(PonyName + "_z", Pony.transform.position.z.ToString()); } SavePonyVisual(Pony.GetComponent <RandomSex>(), PonyName); }
public void SaveGame() { Ini.ClearValues(); Ini.AddHeader("Hello! This is your save game. Please dont move something c:"); Ini.Set("Hours", time.hours.ToString()); Ini.Set("Minutes", time.minutes.ToString()); Ini.Set("Days", time.days.ToString()); SaveCreatures(); SaveBuilding(); SaveWeather(); SaveProgress(); Ini.Save("Save.sv"); }
void SaveProgress() { Ini.AddHeader("Music"); if (music.Lv0played) { Ini.Set("Music_Lvo", "1"); } else { Ini.Set("Music_Lvo", "0"); } if (music.Lv2played) { Ini.Set("Music_Lv2", "1"); } else { Ini.Set("Music_Lv2", "0"); } if (music.Lv3played) { Ini.Set("Music_Lv3", "1"); } else { Ini.Set("Music_Lv3", "0"); } if (music.FightTrackPlayed) { Ini.Set("Music_Fight", "1"); } else { Ini.Set("Music_Fight", "0"); } if (music.SadTrackPlayed) { Ini.Set("Music_Sad", "1"); } else { Ini.Set("Music_Sad", "0"); } }
void SaveBuilding() { Ini.AddHeader("Resourses"); Ini.Set("Wood", res.Wood.ToString()); Ini.Set("Food", res.Food.ToString()); //Ini.Set("Ponies", res.Ponies.ToString()); Ini.AddHeader("Items"); Ini.Set("ItemsCount", res.SaveItems.Count.ToString()); for (int i = 0; i < res.SaveItems.Count; i++) { Ini.Set("Item_" + i + "_x", res.SaveItems[i].transform.position.x.ToString()); Ini.Set("Item_" + i + "_wood", res.SaveItems[i].woodCount.ToString()); Ini.Set("Item_" + i + "_food", res.SaveItems[i].foodCount.ToString()); Ini.Set("Item_" + i + "_bow", res.SaveItems[i].bowCount.ToString()); } Ini.AddHeader("Buildings"); Ini.Set("FireLevel", mainFire.buildingLevel.ToString()); Ini.Set("Warehouse", warehouse.buildingLevel.ToString()); Ini.Set("Weapon", weapon.buildingLevel.ToString()); Ini.Set("Farm", farm.buildingLevel.ToString()); Ini.Set("Houses", houses.buildingLevel.ToString()); Ini.Set("LeftTower", LeftTower.buildingLevel.ToString()); Ini.Set("RightTower", RightTower.buildingLevel.ToString()); Ini.Set("LeftWall", LeftWall.buildingLevel.ToString()); Ini.Set("LeftWall_health", LeftWall.health.ToString()); Ini.Set("RightWall", RightWall.buildingLevel.ToString()); Ini.Set("RightWall_health", RightWall.health.ToString()); for (int i = 0; i < Trees.Length; i++) { if (Trees[i].gameObject.activeSelf) { Ini.Set("Tree_" + i, "1"); } else { Ini.Set("Tree_" + i, "0"); } } }