Example #1
0
    //called by load to apply Data to components
    private void ApplyDataToNPC(NPCData data)
    {
        //eventually just destroy the object and remove it from the dataManager
        if (data.isDead)
        {
            myBrain.isDead = true;
            gameObject.SetActive(false);
            return;
        }

        transform.position = new Vector3(data.currentPosition.x, data.currentPosition.y, data.currentPosition.z);
        bodyParts.LoadSavedParts(data.bodyParts);
    }
Example #2
0
    private void ApplyDataToPlayer(PlayerData data)
    {
        inventory.LoadSavedItems(data.currentInventory);
        wallet.LoadSavedBalance(data.currentGold);
        transform.position = new Vector3(data.currentPosition.x, data.currentPosition.y, data.currentPosition.z);

        myBody.LoadSavedParts(data.bodyParts);
        equipmentManager.LoadSavedEquipment(data.bodyParts);

        combatSkills.LoadSavedCombatLevels(data.combatSkillLevels);
        combatSkills.LoadSavedCombatExperience(data.combatSkillExperience);
        combatSkills.LoadSavedWeaponLevels(data.weaponSkillLevels);
        combatSkills.LoadSavedWeaponExperience(data.weaponSkillExperience);



        Debug.Log("Applied player data");
    }