public SavePlayer(DiContainer container)
        {
            var playerInventory = container.Resolve <PlayerInventoryManager>().model;

            this.money          = playerInventory.money;
            this.playerPosition = new SaveVector3(container.Resolve <PlayerManager>().transform.position);
            this.playerRotation = new SaveVector3(container.Resolve <PlayerManager>().playerCamera.transform.rotation.eulerAngles);

            List <Item> itemList = new List <Item>();

            for (int i = 0; i < playerInventory.itemCollection.Count; i++)
            {
                itemList.Add(playerInventory.itemCollection[i]);
            }
            inventory = new SaveInventory(itemList);
        }
Beispiel #2
0
 public SaveMachineObject(MachineObject machine)
 {
     item          = new SaveItem(machine.item);
     position      = new SaveVector3(machine.transform.position);
     saveInventory = new SaveInventory(machine.inventoryManager.inventory.itemCollection);
 }