Bark on the UI Element

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
MasterDataBase
Posts: 8
Joined: Tue Apr 25, 2023 8:22 am

Bark on the UI Element

Post by MasterDataBase »

Hi All

Maybe this question end to be a silly one, but I don't know how to move, or to say better, I could know, but maybe there is a better way.
My question is the following: There is a way to use emit a Bark from a UI element on a canvas?
At the moment I have few players in game, each player have the relative Dialogue System trigger component and Dialogue Actor, but my goal is to emit the barker not from a game object in the world, but from a UI element.
There is some way to achieve this? at the moment the only way I can imagine is to rewrite few scripts to not use a Transform component as barker, but use a Rect Transform, and then not use an entire canvas to show the bark, but append it to the UI element that emit the bark.
Someone can tell me if there is a simpler way?

Thanks
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark on the UI Element

Post by Tony Li »

Hi,

Sure, you can make the bark UI a child of a UI canvas. Add a Dialogue Actor component to the barker, and assign the bark UI to it.

Alternatively, you duplicate TemplateBarkUI.cs and use it to write your own implementation of the IBarkUI C# interface. Then add it to your UI element and assign it to the barker's Dialogue Actor.
Post Reply