Language
Edit

DialogPool Class

Definition

Spawns IDialog with the requested parameters and manages the lifecycle of the resulting IDialog component.

[UnityEngine.AddComponentMenu("MRTK/UX/Dialog Pool")]
[UnityEngine.ExecuteAlways]
public class DialogPool : UnityEngine.MonoBehaviour
[<UnityEngine.AddComponentMenu("MRTK/UX/Dialog Pool")>]
[<UnityEngine.ExecuteAlways>]
type DialogPool = class
    inherit MonoBehaviour
Public Class DialogPool
Inherits MonoBehaviour
Inheritance
UnityEngine.MonoBehaviour
DialogPool
Attributes
UnityEngine.AddComponentMenuAttribute UnityEngine.ExecuteAlwaysAttribute

Constructors

Name Description
DialogPool()

Properties

Name Description
DialogPrefab

The default prefab to instantiate when spawning a dialog. This prefab must contain a IDialog component.

Methods

Name Description
Get(DialogPool+Policy, GameObject)

Retrieves or creates a new dialog instance. Specify a spawnPolicy to determine how existing dialogs are handled. By default, the spawner will use its DialogPrefab, but a custom prefab can also be specified. Dialogs of different types will be pooled independently. Only one dialog can be visible at a time, globally.

OnValidate()

A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector.

Applies to