ProgressController

Events

chevron-rightOnStartResearchFailedhashtag

Called when starting a research has failed. Returns a ProgressEventStats code

progressController.OnStartResearchFailed += OnResearchFailed;

void OnResearchFailed(ProgressEventData.ProgressEventStatus _status)
{
    Debug.Log("Research failed! Status: " + _status); 
}
chevron-rightOnStartResearchhashtag

Called when a research has been started

progressController.OnStartResearch += OnStartResearch 

void OnStartResearch(ProgressNode _event)
{
    if (_event != null)
    {
        Debug.Log("Research started " + _event.title);
    }          
}
chevron-rightOnResearchCompletehashtag

Called when a research has been completed

progressController.OnResearchComplete += OnResearchComplete;

void OnResearchComplete(ProgressNode _event)
{
    if (_event != null)
    {
       Debug.Log("Research complete " + _event.title);
    }
}
chevron-rightOnResearchUnlockedhashtag

Called when new nodes has been unlocked. Returns a list with all newly unlocked nodes.

progressController.OnResearchUnlocked += OnResearchUnlocked;

void OnResearchUnlocked(List<ProgressNode>_eventData)
{
      Debug.Log("New nodes has been unlocked " + _eventData.Count);      
}  
chevron-rightOnResearchProgresshashtag

Constantly returns the current progress of a research.

progressController.OnResearchProgress += ResearchProgress;

void ResearchProgress(float _value)
{
    Debug.Log("current progress: " + _value);
}

Methods

chevron-rightSetUIControllerhashtag

Set a different Progress UI controller. Can be used to switch between themes for example.

chevron-rightLoadProgressGraphhashtag

Load a Progress Graph. You can optionally pass a name of a Progress Graph. If the name is empty the assigned Progress Graph will be loaded.

chevron-rightStartResearchInProgressGraphByTitlehashtag

Start a new research by its title name.

chevron-rightStartResearchInProgressGraphByGuidhashtag

Start a new research by the progress nodes runtime guid

chevron-rightStartResearchInProgressGraphhashtag

Start new research. Pass in the actual node you want to research.

chevron-rightResetProgressGraphToInitialStatehashtag

Resets the Progress Graph back to it's initial state.

Last updated