예제 #1
0
        /// <summary>
        /// Save the data.
        /// </summary>
        public void Save()
        {
            // Create a new Equipment_Data.
            Character_Class_Data data = new Character_Class_Data();

            // Save the data.
            data.characterClass = characterClass;
            // Turn the Character_Class_Data to Json data.
            string characterClassToJson = JsonUtility.ToJson(data);

            // Save the information.
            PlayerPrefs.SetString("Character_Class", characterClassToJson);
        }
예제 #2
0
        /// <summary>
        /// Load the data.
        /// </summary>
        public void Load()
        {
            // Grab the encrypted Character_Class string.
            string characterClassJson = PlayerPrefs.GetString("Character_Class");

            // IF there is nothing in this string.
            if (String.IsNullOrEmpty(characterClassJson))
            {
                // We need to reach out to our Skill Manager and get our Class.
                //characterClass = Grid_Helper.skillManager.GetCurrentClassChosen ();
                // GTFO of here we done son!
                return;
            }
            // Turn the json data to represent Character_Class_Data.
            Character_Class_Data data = JsonUtility.FromJson <Character_Class_Data> (characterClassJson);

            // Set the class of our character.
            characterClass = data.characterClass;
        }