Class DynamicChatItem
Text items generated by Chat Popups. They bind animation controllers and click events. OnClickAction should handle a string argument being passed and make decisions on what to do based on the argument passed.
Inheritance
Implements
Inherited Members
Namespace: LlamaSoftware.Chat.UI
Assembly: LlamaSoftware.Chat.dll
Syntax
[RequireComponent(typeof(Animator), typeof(TextMeshProUGUI))]
public class DynamicChatItem : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler, IEventSystemHandler
Fields
AnimationController
Override the UnityEngine.Animator's UnityEngine.RuntimeAnimatorController with this one.
Declaration
public RuntimeAnimatorController AnimationController
Field Value
Type | Description |
---|---|
UnityEngine.RuntimeAnimatorController |
animator
Animator for the
Declaration
protected Animator animator
Field Value
Type | Description |
---|---|
UnityEngine.Animator |
ClickId
Id to pass to the OnClickAction when clicks are performed.
Declaration
public string ClickId
Field Value
Type | Description |
---|---|
System.String |
OnClickAction
Click event handler. Should handle a string argument being passed and make decisions on what to do based on the argument passed.
Declaration
public DynamicChatItemEvent OnClickAction
Field Value
Type | Description |
---|---|
DynamicChatItemEvent |
Text
Display text for this chat item. Automatically assigned in Awake().
Declaration
public TextMeshProUGUI Text
Field Value
Type | Description |
---|---|
TMPro.TextMeshProUGUI |
Methods
Awake()
Set up referenes to Animator, TextMeshProUGUI, and assigns the RuntimeAnimationController if provided.
Declaration
protected virtual void Awake()
OnPointerClick(PointerEventData)
Handles pointer click from an UnityEngine.EventSystems.EventTrigger. Invokes OnClickAction with ClickId.
Declaration
public virtual void OnPointerClick(PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.EventSystems.PointerEventData | eventData | Event Data from the EventTrigger |
OnPointerEnter(PointerEventData)
Handles pointer enter from an UnityEngine.EventSystems.EventTrigger. Invokes UnityEngine.Animator.SetTrigger(System.String) with HOVER_IN.
Declaration
public virtual void OnPointerEnter(PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.EventSystems.PointerEventData | eventData | Event Data from the EventTrigger. Not used |
OnPointerExit(PointerEventData)
Handles pointer exit from an UnityEngine.EventSystems.EventTrigger. Invokes UnityEngine.Animator.SetTrigger(System.String) with HOVER_OUT.
Declaration
public virtual void OnPointerExit(PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.EventSystems.PointerEventData | eventData | Event Data from the EventTrigger. Not used |