private Save CreateSaveGameObject() { Save save = new Save(); save.day = day; save.money = PlayerEconomy.Money; save.hayCartFill = 0; save.strawCartFill = 0; HayCart[] carts = FindObjectsOfType <HayCart> (); for (int i = 0; i < carts.Length; ++i) { if (carts [i].fillType == equippableItemID.STRAW) { save.strawCartFill += carts [i].currentUnits; } if (carts [i].fillType == equippableItemID.HAY) { save.hayCartFill += carts [i].currentUnits; } } ConstructionBook conBook = FindObjectOfType <ConstructionBook> (); save.unlockedStallUnits = conBook.unlockedStalls; save.buildingsUnderConstruction = conBook.constructionDaysRemainingPerStallIndex; save.paddockPartitions = conBook.partitionsEnabled; Debug.Log("________________SAVE first parition enabled: " + save.paddockPartitions [0]); return(save); }
void Awake() { constrBook = FindObjectOfType <ConstructionBook> (); if (constrBook == null) { Debug.LogWarning("could not find construction book"); } }