Animate/hide panel after continue button pressed

Announcements, support questions, and discussion for the Dialogue System.
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Animate/hide panel after continue button pressed

Post by cptscrimshaw »

Hmm... doesn't appear to be either. I'm only just changing the position and alpha of the portrait image over time in the animation. Has Exit Time wasn't checked. I'm not animating the text panels at all.

https://ibb.co/NtLx067
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animate/hide panel after continue button pressed

Post by Tony Li »

I think I see what's going on. Since the NPC Subtitle Panel is on top of the Player Subtitle Panel, it blocks the Player Subtitle Panel from view. The NPC Subtitle Panel doesn't disappear until its animation is done. This means it prevents the player's (Sairyn's) name from appearing until the NPC's (Bartholomew's) hide animation has finished.

I had designed my example assuming that you'd be using one subtitle panel. If you want to use two subtitle panels with this kind of setup, it will help to modify it to once again be a bit more like the Runic/WRPG template by keeping all of the text elements (character names and subtitle text) in a shared UI panel. However, it will be easiest if you use different text elements, such as a separate NPC Portrait Name and PC Portrait Name, even though they'll be in the same position. Here's an updated example:

DS_ScrimshawExample2_2021-01-01.unitypackage

I just modified the original example, so if you import it on top of the original example it will replace those files. Key points in this version:
  • The NPC Subtitle Panel and PC Subtitle Panel are separate from the shared Content Panel. The Content Panel contains the portrait names and subtitle text. The subtitle panels only contain the portrait images.
  • I used the subtitle panels' OnClose() UnityEvents to hide its portrait name and subtitle text immediately. This allows the other subtitle panel's versions to appear.
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Animate/hide panel after continue button pressed

Post by cptscrimshaw »

Thanks Tony - works like a charm. I was using the OnOpen() UnityEvents before, but it wasn't working as intended for some reason.

Much appreciated!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Animate/hide panel after continue button pressed

Post by Tony Li »

Glad to help!
Post Reply