Databrain Documentation
databrain.ccDiscord
  • Welcome
  • Installation / Update
  • Interface
  • DataObject Property Drawer
    • No GUI Implemented - FIX
  • Getting started
  • Guides
    • Add data objects
    • Add data objects at runtime
    • Get initial data
    • Get/Set runtime data
    • Serialize DataObjects
    • Runtime Save & Load
    • Use custom serializer
    • Import
    • Search
    • Custom GUI
    • Custom GUI with Odin Inspector
    • Hierarchy Template
  • Separate DataObjects
  • Using Version Control
  • Attributes
    • DataObject attributes
    • Field attributes
  • API
    • DataLibrary
    • DataObject
  • FAQ
    • Databrain - FAQ
  • Add-ons
    • Events
    • Blackboard
    • Logic
      • Interface
      • Create Graph
      • Execute graph
      • Control flow execution in groups
      • Custom Nodes
        • Asynchronous execution
        • Node Attributes
      • Scene Components
      • Graph Events
      • Finite State Machine
        • Create custom Actions
        • Examples
        • State Machine Nodes
    • Stats
      • Achievements
      • Modifiers
      • Values
      • Progressions
      • Components
      • Nodes
    • Progress
      • Progress Settings
      • Progress Graph
      • Progress Resources
      • Runtime UI Setup
      • API
        • ProgressController
    • Techtree (LEGACY)
      • Techtree Manager
      • Techtree
      • TechtreeResource
      • Techtree UIBuilder
        • Custom Techtree Node Button
        • Tooltip
      • API
    • Localization
      • Localization Manager
      • Localization
      • Examples
      • Components
      • Import
      • API
    • Inventory
      • Getting started
      • Demo
      • Data setup
        • Inventories
        • Slot IDs
        • Items
          • Blueprints
          • Item rarities
        • Money
        • Loot tables
        • Events
      • Runtime UI
        • Setup
    • Dialogue
      • Getting Started
        • Demo
      • Dialogue runtime setup
      • Actors
        • Emotions
      • Localization
      • Audio
      • Animation
      • Variables
      • Custom theme
      • Import
      • Nodes
      • API
        • DialogueController
        • IDialogueUIControl
  • Changelog
    • Databrain - Changelog
      • 1.4.0
      • 1.3.2
      • 1.3.1
      • 1.3.0
      • 1.2.0
      • 1.1.0
      • 1.0.10
      • 1.0.9
      • 1.0.8
      • 1.0.7
      • <= 1.0.6
Powered by GitBook
On this page
  • Events
  • Methods
  1. Add-ons
  2. Progress
  3. API

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.

progressController.SetUIController(themeObject1);
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.

progressController.LoadProgressGraph();

progressController.LoadProgressGraph("PlayerProgress");
StartResearchInProgressGraphByTitle

Start a new research by its title name.

public void StartResearchSpecificNode()
{
    // Research a specific node in the progress graph
    var _node = progressController.StartResearchInProgressGraphByTitle("Bio Engineering");

    if (_node != null)
    {
        _node.OnResearchProgress -= Progress;
        _node.OnResearchProgress += Progress;
     }
    else
    {
        // Research failed. Maybe because we don't have enough resources
        Debug.Log("Research failed, not enough resources");
    }
}
StartResearchInProgressGraphByGuid

Start a new research by the progress nodes runtime guid

public ProgressNode MyProgressNode;

progressController.StartResearchInProgressGraphByGuid(MyProgressNode.GetRuntimeDataObject().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.

PreviousAPINextTechtree (LEGACY)

Last updated 8 months ago