Example #1
0
    //Called by Save() to grab data from componets and put that in the Data class
    private NPCData PackageNPCData()
    {
        NPCData data = new NPCData();

        Vector3 pos = transform.position;

        data.currentPosition = new SavedPosition {
            x = pos.x, y = pos.y, z = pos.z
        };
        data.isDead    = myBrain.isDead;
        data.bodyParts = bodyParts.GetBodyParts();

        return(data);
    }
Example #2
0
    private PlayerData PackagePlayerData()
    {
        PlayerData data = new PlayerData();

        Vector3 pos = transform.position;

        data.currentPosition = new SavedPosition {
            x = pos.x, y = pos.y, z = pos.z
        };

        data.currentInventory = inventory.GetInventoryItems();
        data.currentGold      = wallet.GetCurrentBalance();
        data.bodyParts        = myBody.GetBodyParts();

        data.combatSkillLevels     = combatSkills.GetCombatLevels();
        data.combatSkillExperience = combatSkills.GetCombatExperience();
        data.weaponSkillLevels     = combatSkills.GetWeaponLevels();
        data.weaponSkillExperience = combatSkills.GetWeaponExperience();
        return(data);
    }