public SaveDataBase SaveData() { PlayerSaveData saveData = new PlayerSaveData() { Name = gameObject.name, Position = transform.position, Rotation = transform.rotation, CurrentHealth = HealthComponent.Health, EquippedWeaponData = new WeaponSaveData(WeaponHolder.CurrentWeapon.WeaponInformation), }; var itemSaveList = Inventory.GetItemList().Select(item => new ItemSaveData(item)).ToList(); saveData.ItemList = itemSaveList; return(saveData); }
public SaveDataBase SaveData() { Debug.Log("HEALTH" + HealthComponent.Health); PlayerSaveData saveData = new PlayerSaveData { Name = gameObject.name, Position = transform.position, Rotation = transform.rotation, CurrentHealth = HealthComponent.Health, EquippedWeaponData = new WeaponSaveData(WeaponHolder.EquippedWeapon.WeaponStats) }; var itemSaveList = Inventory.GetItemList().Select(item => new ItemSaveData(item)).ToList(); saveData.itemList = itemSaveList; return(saveData); }