Class SocialUIPopup
This is largely the same as ChatPopup. We need different references here like Player instead of UIChatMessage for example. A popup container for propagating clicks on Social UI elements.
Assign your own custom subclass of SocialUIClickHandler to manage the actual clicking functionality.
Note: OnDeselect(BaseEventData) calls UnityEngine.Animator.SetTrigger(System.String) with FADE_OUT. To avoid warnings the UnityEngine.RuntimeAnimatorController should have a Trigger with that name.
Inheritance
Implements
Inherited Members
Namespace: LlamaSoftware.Chat.UI
Assembly: LlamaSoftware.Chat.dll
Syntax
public class SocialUIPopup : MonoBehaviour, IDeselectHandler, IEventSystemHandler
Fields
AnimationController
Optional RuntimeAnimatorController. If assigned it will override whatever is assigned to the animator in Awake().
Declaration
public RuntimeAnimatorController AnimationController
Field Value
Type | Description |
---|---|
UnityEngine.RuntimeAnimatorController |
animator
Animator for this Popup. Automatically assigned in Awake(). If AnimationController is assigned, will override whatever is set up in the inspector.
Declaration
[HideInInspector]
public Animator animator
Field Value
Type | Description |
---|---|
UnityEngine.Animator |
canvasGroup
CanvasGroup for this Popup. Automatically assigned / configured in Awake().
Declaration
[HideInInspector]
public CanvasGroup canvasGroup
Field Value
Type | Description |
---|---|
UnityEngine.CanvasGroup |
chatPanel
Chat Panel instance. This is assigned by the ChatPanel.
Declaration
public ChatPanel chatPanel
Field Value
Type | Description |
---|---|
ChatPanel |
ClickedPlayer
The Player that was clicked.
Declaration
public SocialPlayer ClickedPlayer
Field Value
Type | Description |
---|---|
SocialPlayer |
ClickHandler
Click handler to manage events.
Declaration
public SocialUIClickHandler ClickHandler
Field Value
Type | Description |
---|---|
SocialUIClickHandler |
IsSelected
If this is selected or not. If you want to show this popup then you should assign it to true in your custom HandleClick(ChatPopup, TMP_LinkInfo, PointerEventData). Is set to false automatically in the OnDeselect(BaseEventData).
Declaration
public bool IsSelected
Field Value
Type | Description |
---|---|
System.Boolean |
LocalPlayer
Local Player_Chat instance. Assigned in OnStartLocalPlayer().
Declaration
public Player_Chat LocalPlayer
Field Value
Type | Description |
---|---|
Player_Chat |
Options
List of available Chat Item options.
Declaration
public List<DynamicChatItem> Options
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<DynamicChatItem> |
rectTransform
RectTransform for this Popup. Automatically assigned / configured in Awake()
Declaration
[HideInInspector]
public RectTransform rectTransform
Field Value
Type | Description |
---|---|
UnityEngine.RectTransform |
selectable
Selectable for this Popup. Automatically assigned / configured in Awake()
Declaration
[HideInInspector]
public Selectable selectable
Field Value
Type | Description |
---|---|
UnityEngine.UI.Selectable |
Methods
Awake()
Sets up the component, adds required components if missing
Declaration
protected virtual void Awake()
HandleClick(SocialPlayer, PointerEventData)
Just calls the click handler and give it a referece to this class since we have a lot of referenes it will need to do any interesting behaviors.
Declaration
public virtual void HandleClick(SocialPlayer ClickedPlayer, PointerEventData pointerEventData)
Parameters
Type | Name | Description |
---|---|---|
SocialPlayer | ClickedPlayer | Player that was clicked on. |
UnityEngine.EventSystems.PointerEventData | pointerEventData | Event Data |
OnDeselect(BaseEventData)
This is automatically called on deselect because of UnityEngine.EventSystems.IDeselectHandler. Resets IsSelected = false and calls UnityEngine.Animator.SetTrigger(System.String) with FADE_OUT.
Declaration
public virtual void OnDeselect(BaseEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.EventSystems.BaseEventData | eventData |