Skip to main content

Dialogue System

danger

The Dialogue System is currently not available in the Dev Kit.

The Dialogue System in the Genies SDK offers a easy way to add multiple choice dialogue interactions. When a user decides on an option, you can lead the user into another dialogue branch or affect the Unity scene in some way.

info

The UI for the dialogue system is customizable.

Example UI

Setting the Dialogue System up

Drag the DialogueSystem.prefab from GeniesSdk/Prefabs/DialogueSystem/ into the scene hierarchy under a GameObject with a Canvas component.

Hierarchy

caution

The DialogueSystem prefab will not work without being a child of a UI Canvas.

TypeScript Usage

Using the Dialogue Manager requires using TypeScript to script the logic.

Package

The Dialogue Manager API requires importing the library like so:

import { DialoguePopup, DialoguePopupManager } from "RootNamespace";

Example

Here is an example script that creates a new dialogue at the start:

import { DialoguePopup, DialoguePopupManager } from "RootNamespace";
import { List$1 } from "System.Collections.Generic";
import { TaskCompletionSource$1 } from "System.Threading.Tasks";
import { MonoBehaviour } from "UnityEngine";

export default class MyScript extends MonoBehaviour {

@SerializeField private myDialogue: DialoguePopupManager;
@SerializeField private myPopup: DialoguePopup;

private Start() : void {
this.myDialogue.SetDialogueBox(this.myPopup);
let task: TaskCompletionSource$1<number>;
let promptText: string;
let options: List$1<string>;
let typingSpeed: number;
this.myPopup.SetDialogue(task, promptText, options, typingSpeed);
}
}