UnityToolbox
Brief documentation for all existing scripts.
 
Loading...
Searching...
No Matches
GamestateManager Class Reference

This module manages all gamestates. The SaveGameManager is required for it to keep track of the players progress.

Inheritance diagram for GamestateManager:
Module

Public Member Functions

void Start ()
 
bool IsStateActive (string stateName)
 Checks whether a given state name is active or not.
 
void GoToNextState (string currentState, int option)
 Proceeds to the next state if possible. Sets the current state to inactive.
 
- Public Member Functions inherited from Module
virtual void Awake ()
 

Static Public Attributes

const string FILENAME = "GamestateData.txt"
 

Events

Action< string > OnGamestateCompleted
 An event which is triggered once the gamestate with the given string ID is completed;.
 

Member Function Documentation

◆ GoToNextState()

void GamestateManager.GoToNextState ( string  currentState,
int  option 
)
Parameters
currentStateThe current gamestate.
optionWhich path the gamestate should take within the tree. Input 0 if it is linear.
Exceptions
ArgumentException

References GamestateNodeData.Name, and OnGamestateCompleted.

◆ IsStateActive()

bool GamestateManager.IsStateActive ( string  stateName)
Parameters
stateNameThe unique name of the state.
Returns
Whether the gamestate is active.

Referenced by UnityToolbox.UI.Dialog.DialogManager.StartDialog().

◆ Start()

void GamestateManager.Start ( )

Member Data Documentation

◆ FILENAME

const string GamestateManager.FILENAME = "GamestateData.txt"
static

Referenced by Start().

Event Documentation

◆ OnGamestateCompleted

Action<string> GamestateManager.OnGamestateCompleted

Referenced by GoToNextState().