Next: , Up: Top   [Contents][Index]


1 AchievementHandler

Component: AchievementHandler

This component provides support of a discreet list of achievements. It can be assigned on a per-object basis, for ’context-sensitive’ achievements, or you can use just one in your whole game for a global achievement list. The latter is the conventional approach. To use it in this way, simply add it to an empty game object and set up a list of achievements. Then, assign a tag, perhaps ’achievementManager’ to the object. Add a ’Persistent’ component so it stays between scenes. Finally, broadcast the ’Increment’ message to it. When an achievement is completed, the ’Completion Message’ is sent from the corresponding achievement, great for adding effects & sound, popups etc as reward.The ’On Load Or Completion Message’ allows you to add unlockables to achievements. —-Messages:—- The ’Increment’ message takes a string, which is the name of the achievement we are incrementing. This component can also ’Save’ and ’Load’ it’s achievement list from PlayerPrefs, which is supported on all platforms.

Field of AchievementHandler: bool showGui

A legacy Unity GUI listing all achievements and their level of completion. Not recommended for mobile.

Default value: false

Field of AchievementHandler: Rect guiArea

A normalized viewport rectangle describing the portion of the screen to use for displaying the achievement list. Values between 0 and 1

Default value: new Rect(0.2f, .2f, 0.6f, 0.6f)

Field of AchievementHandler: GUISkin guiSkin

An optional GUI Skin to use for the achievement list display on-screen.

Field of AchievementHandler: bool fadeMusic

If there is a MusicManager in the scene, should we fade it out during the acievement?

Default value: true

Available Messages

Message on AchievementHandler: Increment (string)

takes a string, which is the name of the achievement we are incrementing

Argument: Name of the achievement we wish to increment. Must match the name above exactly.

Message on AchievementHandler: Save ()

Saves the player’s achievements to Player Prefs. Works on all platforms

Message on AchievementHandler: Load ()

Loads the player’s achievements from Player Prefs. Works on all platforms

Message on AchievementHandler: OpenMenu ()

Opens the legacy GUI. Not suitable for mobile.

Message on AchievementHandler: CloseMenu ()

Closes the legacy GUI. Not suitable for mobile.

Message on AchievementHandler: ToggleMenu ()

Toddles the legacy GUI. Not suitable for mobile.

Field of AchievementHandler: bool showGui

A legacy Unity GUI listing all achievements and their level of completion. Not recommended for mobile.

Default value: false

Field of AchievementHandler: Rect guiArea

A normalized viewport rectangle describing the portion of the screen to use for displaying the achievement list. Values between 0 and 1

Default value: new Rect(0.2f, .2f, 0.6f, 0.6f)

Field of AchievementHandler: GUISkin guiSkin

An optional GUI Skin to use for the achievement list display on-screen.

Field of AchievementHandler: bool fadeMusic

If there is a MusicManager in the scene, should we fade it out during the acievement?

Default value: true

Available Messages

Message on AchievementHandler: Increment (string)

takes a string, which is the name of the achievement we are incrementing

Argument: Name of the achievement we wish to increment. Must match the name above exactly.

Message on AchievementHandler: Save ()

Saves the player’s achievements to Player Prefs. Works on all platforms

Message on AchievementHandler: Load ()

Loads the player’s achievements from Player Prefs. Works on all platforms

Message on AchievementHandler: OpenMenu ()

Opens the legacy GUI. Not suitable for mobile.

Message on AchievementHandler: CloseMenu ()

Closes the legacy GUI. Not suitable for mobile.

Message on AchievementHandler: ToggleMenu ()

Toddles the legacy GUI. Not suitable for mobile.


Next: , Up: Top   [Contents][Index]