The XP would just be a variable (int/float) that you would have a few different ways of gathering.
Basically, the way I would do it is.
- Create an empty gameObject and name it go_manager_xp //the empty game object will basically just be a place in your hierarchy there you manage the collection of XP, a defined place to contain the FSM events and get orders to increase the xp numerical variable.
- Make a global variable called playerXP //this will be the amount of experience points the player currently has.
- In your mining FSM in the event that you successfully mine a vein you can either use send event to object fsm and direct the manager to run an event and add float/int Nth to the XP variable you defined or you can broadcast the event while the xp manager is idle and listening for an event to run.
Basically just make the manager wait for the event, make a blank state and add transitions that are global events like "addXP" so when an action sends the 'do this' command then it runs the event, adds to the xp variable and loops back to the idle listener state when its done.
To create the GUI reference you can briefly make a quick fix for testing by creating a GUILayout Float(or Int) Field and have it reflect the global
playerXP variable. This should be updated regularly, like when the manager loops back to idle state or something.