Search Results for

    Show / Hide Table of Contents

    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
    System.Object
    StatemachineConnector
    Namespace: Static
    Assembly: Assembly-CSharp.dll
    Syntax
    public class StatemachineConnector

    Fields

    | Improve this Doc View Source

    errorCounter

    The amount of errors performed by the user of the training.

    Declaration
    public int errorCounter
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Instance

    The static instance of this StatemachineConnector.

    Declaration
    public static StatemachineConnector Instance
    Field Value
    Type Description
    StatemachineConnector

    Methods

    | Improve this Doc View Source

    AcceptedStateChange(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

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    Reset()

    Resets the instance of this static instance.

    Declaration
    public void Reset()
    | Improve this Doc View Source

    ShowCompletionOverlay()

    Triggers the scenario completion overlay.

    Declaration
    public void ShowCompletionOverlay()
    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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 Source

    TriggerAcceptedStateChange

    Declaration
    public event Action<bool> TriggerAcceptedStateChange
    Event Type
    Type Description
    System.Action<System.Boolean>
    | Improve this Doc View Source

    TriggerErrorOverlay

    Declaration
    public event Action<string, string> TriggerErrorOverlay
    Event Type
    Type Description
    System.Action<System.String, System.String>
    | Improve this Doc View Source

    TriggerExpertInsights

    Declaration
    public event Action<AudioClip, Sprite, string> TriggerExpertInsights
    Event Type
    Type Description
    System.Action<AudioClip, Sprite, System.String>
    | Improve this Doc View Source

    TriggerScenarioCompletionOverlay

    Declaration
    public event Action TriggerScenarioCompletionOverlay
    Event Type
    Type Description
    System.Action
    | Improve this Doc View Source

    TriggerTopPanelChange

    Declaration
    public event Action<string, int> TriggerTopPanelChange
    Event Type
    Type Description
    System.Action<System.String, System.Int32>
    | Improve this Doc View Source

    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>>
    • Improve this Doc
    • View Source
    In This Article
    Back to top TrainAR Documentation