Class StatemachineConnector
The StatemachineConnector connects interaction inputs with the visual scripting flow and outputs with the instruction, error and insight controller through events. It therefore functions as a funnel between the Visual Statemachine and the rest of the logic.
Either the visual statemachien decides whether actions are correct or wrong (default) or the connection can also be commented out and the decisions on wrong/correct actions can be made manually in the RequestStateChange method by using C# programming.
Inheritance
Namespace: Static
Assembly: Assembly-CSharp.dll
Syntax
public class StatemachineConnector
Fields
| Improve this Doc View SourceerrorCounter
The amount of errors performed by the user of the training.
Declaration
public int errorCounter
Field Value
Type | Description |
---|---|
System.Int32 |
Instance
The static instance of this StatemachineConnector.
Declaration
public static StatemachineConnector Instance
Field Value
Type | Description |
---|---|
StatemachineConnector |
Methods
| Improve this Doc View SourceAcceptedStateChange(Boolean)
Called by the state machine. Triggers an Action that indicates if the state change was accepted.
Declaration
public void AcceptedStateChange(bool stateChangeAccepted)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | stateChangeAccepted | Is the statechange accepted |
RegisterNewStateChangeTrigger(Func<StateInformation, Boolean>)
Registers a new state change trigger from the visual state flow. This trigger determines which node in the visual scripting graph is handling the state change request.
Declaration
public static void RegisterNewStateChangeTrigger(Func<StateInformation, bool> action)
Parameters
Type | Name | Description |
---|---|---|
System.Func<StateInformation, System.Boolean> | action | The Func to that is registered. |
RequestStateChange(StateInformation)
Request a statechange from the statemachine.
Declaration
public bool RequestStateChange(StateInformation stateInformation)
Parameters
Type | Name | Description |
---|---|---|
StateInformation | stateInformation |
Returns
Type | Description |
---|---|
System.Boolean |
Reset()
Resets the instance of this static instance.
Declaration
public void Reset()
ShowCompletionOverlay()
Triggers the scenario completion overlay.
Declaration
public void ShowCompletionOverlay()
ShowErrorOverlay(String, String)
Called by the visual state machine. Triggers an Action that shows the error overlay.
Declaration
public void ShowErrorOverlay(string headerText, string errorText)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerText | The Header of the error overlay |
System.String | errorText | The text body of the error overlay |
ShowExpertInsights(AudioClip, Sprite, String)
Called by the visual state machine. Triggers an Action that shows the expert insight modality and plays and audio clip.
Declaration
public void ShowExpertInsights(AudioClip audio, Sprite image, string text)
Parameters
Type | Name | Description |
---|---|---|
AudioClip | audio | The audioclip that is played with the expert insight |
Sprite | image | The image that is displayed, e.g. the expert providing the insight. |
System.String | text | The text displayed at the expert speechbubble |
StartQuestionUI(QuestionnaireController.QuestionUITypes, String, List<QuestionnaireController.Answer>)
Triggers a new Questionnaire to be answered by the user on the UI.
Declaration
public void StartQuestionUI(QuestionnaireController.QuestionUITypes type, string question, List<QuestionnaireController.Answer> answers)
Parameters
Type | Name | Description |
---|---|---|
QuestionnaireController.QuestionUITypes | type | The type of Question(MultipleChoice, List, Input). |
System.String | question | The question. |
System.Collections.Generic.List<QuestionnaireController.Answer> | answers | A List of struct with all possible answers. |
UpdateTopPanel(String, Int32)
Called by the visual state machine, triggers an Action that updates the instruction text and completion percentage of the top panel.
Declaration
public void UpdateTopPanel(string text, int completionPercentage)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | New instruction displayed on the top panel |
System.Int32 | completionPercentage | New compeltion percentage displayed |
Events
| Improve this Doc View SourceTriggerAcceptedStateChange
Declaration
public event Action<bool> TriggerAcceptedStateChange
Event Type
Type | Description |
---|---|
System.Action<System.Boolean> |
TriggerErrorOverlay
Declaration
public event Action<string, string> TriggerErrorOverlay
Event Type
Type | Description |
---|---|
System.Action<System.String, System.String> |
TriggerExpertInsights
Declaration
public event Action<AudioClip, Sprite, string> TriggerExpertInsights
Event Type
Type | Description |
---|---|
System.Action<AudioClip, Sprite, System.String> |
TriggerScenarioCompletionOverlay
Declaration
public event Action TriggerScenarioCompletionOverlay
Event Type
Type | Description |
---|---|
System.Action |
TriggerTopPanelChange
Declaration
public event Action<string, int> TriggerTopPanelChange
Event Type
Type | Description |
---|---|
System.Action<System.String, System.Int32> |
TriggerUIQuestion
Declaration
public event Action<QuestionnaireController.QuestionUITypes, string, List<QuestionnaireController.Answer>> TriggerUIQuestion
Event Type
Type | Description |
---|---|
System.Action<QuestionnaireController.QuestionUITypes, System.String, System.Collections.Generic.List<QuestionnaireController.Answer>> |