コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }