ProgressController

Events

OnStartResearchFailed

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); 
}
OnStartResearch

Called when a research has been started

progressController.OnStartResearch += OnStartResearch 

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

Called when a research has been completed

progressController.OnResearchComplete += OnResearchComplete;

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

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);      
}  
OnResearchProgress

Constantly returns the current progress of a research.

progressController.OnResearchProgress += ResearchProgress;

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

Methods

SetUIController

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

LoadProgressGraph

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.

StartResearchInProgressGraphByTitle

Start a new research by its title name.

StartResearchInProgressGraphByGuid

Start a new research by the progress nodes runtime guid

StartResearchInProgressGraph

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

ResetProgressGraphToInitialState

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

Last updated