public void AddAchievementMission(int num)
    {
        //int val = Random.Range(0, (int)MissionBase.MissionType.MAX);

        AchievementMissionBase newMission = AchievementMissionBase.GetNewMissionFromType((AchievementMissionBase.MissionType)num);

        newMission.Created();

        achievementMissions.Add(newMission);
    }
    public void Read()
    {
        BinaryReader r = new BinaryReader(new FileStream(saveFile, FileMode.Open));

        int ver = r.ReadInt32();

        if (ver < 6)
        {
            r.Close();

            NewSave();
            r   = new BinaryReader(new FileStream(saveFile, FileMode.Open));
            ver = r.ReadInt32();
        }

        stars = r.ReadInt32();

        /*
         * consumables.Clear();
         * int consumableCount = r.ReadInt32();
         * for (int i = 0; i < consumableCount; ++i)
         * {
         *  consumables.Add((Consumable.ConsumableType)r.ReadInt32(), r.ReadInt32());
         * }
         */

        // Read character.
        characters.Clear();
        int charCount = r.ReadInt32();

        for (int i = 0; i < charCount; ++i)
        {
            string charName = r.ReadString();

            /*
             * if (charName.Contains("Raccoon") && ver < 11)
             * {//in 11 version, we renamed Raccoon (fixing spelling) so we need to patch the save to give the character if player had it already
             *  charName = charName.Replace("Racoon", "Raccoon");
             * }
             */
            characters.Add(charName);
        }

        // Read skin.
        skins.Clear();
        int skinCount = r.ReadInt32();

        for (int i = 0; i < skinCount; ++i)
        {
            string skinName = r.ReadString();

            /*
             * if (charName.Contains("Raccoon") && ver < 11)
             * {//in 11 version, we renamed Raccoon (fixing spelling) so we need to patch the save to give the character if player had it already
             *  charName = charName.Replace("Racoon", "Raccoon");
             * }
             */
            skins.Add(skinName);
        }

        tutorialCompletion = r.ReadBoolean();
        tutorialCheck      = r.ReadBoolean();
        koreanCheck        = r.ReadBoolean();

        usedCharacter = r.ReadInt32();
        usedSkin      = r.ReadInt32();

        /*
         * // Read character accesories.
         * characterAccessories.Clear();
         * int accCount = r.ReadInt32();
         * for (int i = 0; i < accCount; ++i)
         * {
         *  characterAccessories.Add(r.ReadString());
         * }
         *
         * // Read Themes.
         * themes.Clear();
         * int themeCount = r.ReadInt32();
         * for (int i = 0; i < themeCount; ++i)
         * {
         *  themes.Add(r.ReadString());
         * }
         *
         * usedTheme = r.ReadInt32();
         */
        // Save contains the version they were written with. If data are added bump the version & test for that version before loading that data.
        if (ver >= 2)
        {
            coins = r.ReadInt32();
        }


        // Added highscores.
        if (ver >= 3)
        {
            highscores.Clear();
            int count = r.ReadInt32();
            for (int i = 0; i < count; ++i)
            {
                HighscoreEntry entry = new HighscoreEntry();
                entry.name  = r.ReadString();
                entry.score = r.ReadInt32();

                highscores.Add(entry);
            }
        }

        // Added missions.
        if (ver >= 4)
        {
            missions.Clear();

            int count = r.ReadInt32();
            for (int i = 0; i < count; ++i)
            {
                MissionBase.MissionType type        = (MissionBase.MissionType)r.ReadInt32();
                MissionBase             tempMission = MissionBase.GetNewMissionFromType(type);

                tempMission.Deserialize(r);

                if (tempMission != null)
                {
                    missions.Add(tempMission);
                }
            }

            achievementMissions.Clear();

            int aCount = r.ReadInt32();
            for (int i = 0; i < aCount; ++i)
            {
                AchievementMissionBase.MissionType type = (AchievementMissionBase.MissionType)r.ReadInt32();
                AchievementMissionBase             achievementTempMission = AchievementMissionBase.GetNewMissionFromType(type);

                achievementTempMission.Deserialize(r);

                if (achievementTempMission != null)
                {
                    achievementMissions.Add(achievementTempMission);
                }
            }
        }

        // Added highscore previous name used.
        if (ver >= 7)
        {
            previousName = r.ReadString();
        }

        /*
         * if (ver >= 8)
         * {
         *  licenceAccepted = r.ReadBoolean();
         * }
         */
        if (ver >= 9)
        {
            masterVolume    = r.ReadSingle();
            musicVolume     = r.ReadSingle();
            masterSFXVolume = r.ReadSingle();
        }

        if (ver >= 10)
        {
            ftueLevel         = r.ReadInt32();
            rank              = r.ReadInt32();
            adsActivatingTime = r.ReadInt64();
        }

        r.Close();
    }