Topic: [Tutorial] Unlockable Characters - Using included functions
In this thread, I'll give you information on the character unlocking functions included in UFE and also an example of how you can use them in your game.
This first post is informational about each of the included functions. You won't need Source to use the functions, but Source will help you understand them better and possibly help with creating your own functions should you need them.
Click here to skip to the tutorial.
Unlocking Related Methods
All Character Unlocking related methods are located in UFE.cs, inside the region "public class methods: methods related to the character selection". Each of these can be used with the prefix UFE. (e.g. UFE.LoadUnlockedCharacters();).
public static void LoadUnlockedCharacters()
This function loads the currently unlocked characters. It is run automatically in UFE.cs Awake() method. You may want to call this function after any new characters have been unlocked (to ensure they're loaded).
public static void SaveUnlockedCharacters()
This function saves the currently unlocked characters. If you right click and select Find References in MonoDevelop, you'll see this is called from a number of the other functions below. If you coded your own function and need to save the currently unlocked characters, then you should call this function with SaveUnlockedCharacters() if your code is in UFE.cs, or UFE.SaveUnlockedCharacters() if elsewhere.
public static void RemoveUnlockedCharacterInStoryMode(CharacterInfo character)
This function removes the provided character from Story Mode selection. Use this for removing a single character from story mode selection.
public static void RemoveUnlockedCharacterInVersusMode(CharacterInfo character)
This function removes the provided character from Versus Mode selection. Use this for removing a single character from versus mode selection.
public static void RemoveUnlockedCharactersInStoryMode()
This function removes all unlocked characters from Story Mode selection. Use this to remove all unlocked characters from story mode selection.
public static void RemoveUnlockedCharactersInVersusMode()
This function removes all unlocked characters from Versus Mode selection. Use this to remove all unlocked characters from versus mode selection.
public static void UnlockCharacterInStoryMode(CharacterInfo character)
This function unlocks the provided character in Story Mode selection. Use this to unlock a specific character for story mode.
public static void UnlockCharacterInVersusMode(CharacterInfo character)
This function unlocks the provided character in Versus Mode selection. Use this to unlock a specific character for versus mode.