-
Notifications
You must be signed in to change notification settings - Fork 5
Plugin structure
-
gd_achievements.gd: Main plugin script that loads basic nodes and other data.
-
gd-achievements/achievements_notification.tscn: Scene with default achievement's notification UI design that you can change
-
gd-achievements/achievements_notification.gd: Provides main functions for achievement UI node:-
set_achievement(achievement): Sets the data from achievement json object such as name and icon; -
on_show(): Calls a popup animation for an achievement notification -
on_hide(): Calls a hide animation after showing a notification
-
-
scripts/achievements_manager.gd:
Manager's script. He does all work with reading and updating achievement's data. The main concept is that we put generated .json file inside the game as reference and his duplicate on user's device that we update after we get any achievement. If game rebooted it will check hash code both of files. In case they are different, Manager will update data from user's device file to game. This will prevent repeated notification calls from happening. On getting achievement it will send achievement_unlocked signal to
achievement_notification.gd script with data about it.
-
scripts/achievements_notification.gd:
Executes logic for achievement displaying and provides editor's settings. On calling an achievement it will execute functions that described in achievements_notification.gd script (see Frontend section).