public void SaveGameStatistics(QuickLife script) { GameMemento newMemento = Instantiate(MementoType).GetComponent <GameMemento>(); newMemento.InitializeGame(this); script.SaveMemento(newMemento); }
public void SaveInventory(QuickLife script) { for (int i = 0; i < items.Count; i++) { if (i == handIndex) { ConcreteItem itemInHand = handScript as ConcreteItem; if (itemInHand) { ItemMementos[i] = itemInHand.CreateInventoryMemento(); //The item in your hand will already be saved in the QuickLife script by the timeVibration script.SaveMemento(ItemMementos[i]); } } else { ItemMemento newMemento = Instantiate(MementoType).GetComponent <ItemMemento>(); newMemento.InitializeInventory(i); script.SaveMemento(newMemento); //Place memento into a list of Mementos ItemMementos[i] = newMemento; } } }