Пример #1
0
    public void loadItems()
    {
        ItemData data = Save_script.loadItems();

        if (data != null)
        {
            items = data.items;
        }
    }
Пример #2
0
    public void loadSpells()
    {
        SpellData data = Save_script.loadSpells();

        if (data != null)
        {
            spells = data.spells;
        }
    }
Пример #3
0
 public void saveItems()
 {
     Save_script.saveItems(this);
     Debug.Log("Item data saved!");
 }
 public void savePlayer()
 {
     Save_script.savePlayer(this);
     Debug.Log("Player data saved!");
     _notification.message("Player data saved!", 3, "white");
 }
    public void loadPlayer()
    {
        CharacterData data = Save_script.loadPlayer();

        if (data == null)
        {
            _notification.message("Save cannot be loaded!", 3, "red");
        }
        else
        {
            //customization
            Player_name   = data.Player_name;
            Player_class  = data.Player_class;
            Player_talent = data.Player_talent;

            sex        = data.sex;
            hideHelmet = data.hideHelmet;

            hair_id  = data.hair_id;
            eyes_id  = data.eyes_id;
            nose_id  = data.nose_id;
            mouth_id = data.mouth_id;
            body_id  = data.body_id;

            hair_color = data.hair_color;

            //stats
            Player_xp              = data.Player_xp;
            Player_needed_xp       = data.Player_needed_xp;
            Player_level           = data.Player_level;
            Player_money           = data.Player_money;
            Player_plus_money_rate = data.Player_plus_money_rate;
            Player_penalty_rate    = data.Player_penalty_rate;
            Inventory              = data.Inventory;
            Equipments             = data.Equipments;
            Spells              = data.Spells;
            Talents             = data.Talents;
            Player_spell_points = data.Player_spell_points;
            Player_max_health   = data.Player_max_health;
            Player_max_resource = data.Player_max_resource;
            Player_damage       = data.Player_damage;

            defeated_enemies        = data.defeated_enemies;
            completed_conversations = data.completed_conversations;
            accepted_quests         = data.accepted_quests;
            completed_quests        = data.completed_quests;


            _gameManager.Change_screen(_gameManager.Character_screen_UI, true);
            _gameManager.isNewCharacter = true;

            //gameObject.GetComponent<Spell_script>().initializeSpells();
            gameObject.GetComponent <Spell_script>().checkRowAvailability();

            GameObject.Find("Conversation").GetComponent <Conversation_script>().initializeConversations();

            _questManager.checkAvailableQuests();
            _questManager.haveCompletedQuest();



            _notification.message("Save loaded!", 3, "white");
        }
    }
Пример #6
0
 public void saveSpells()
 {
     Save_script.saveSpells(this);
     Debug.Log("Spell data saved!");
 }