Send Open Message to UIPanel

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Send Open Message to UIPanel

Post by nathanj »

Hey Tony

Haven't yet cracked open the source code so would you mind letting me know how to send an Open message through the sequencer to Dialogue System's UIPanel component?

I tried this "SendMessage(Open,,UIPanelX)" but it's not working.

Thanks in advance,

Nathan
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: Send Open Message to UIPanel

Post by Tony Li »

Hi Nathan,

You may need to activate the GameObject first, since SendMessage() doesn't work on inactive GameObjects. Try something like this:

Code: Select all

SetActive(UIPanelX);
SendMessage(Open,,UIPanelX)
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Send Open Message to UIPanel

Post by nathanj »

That was it!

Thanks, Tony
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Send Open Message to UIPanel

Post by nathanj »

Hey again,

Hopefully this is a quick answer.

I'm still a little vague about how Show Animation Trigger and Hide Animation Trigger work. Do they apply to the Canvas group component attached to the canvas of whichever component they belong to?

I just made a new Canvas and added a panel with a UIPanel component. When I open the UI panel I get this yellow flag:

Code: Select all

Parameter 'Show' does not exist.
UnityEngine.Animator:SetTrigger(String)
PixelCrushers.<WaitForAnimation>c__Iterator0:MoveNext() (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UIAnimatorMonitor.cs:54)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
PixelCrushers.UIAnimatorMonitor:SetTrigger(String, Action, Boolean) (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UIAnimatorMonitor.cs:46)
PixelCrushers.UIPanel:Open() (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UIPanel.cs:155)
UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
PixelCrushers.DialogueSystem.Sequencer:HandleSendMessageInternally(String, String[]) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Model-View-Controller/View/Sequencer/Sequencer.cs:1504)
PixelCrushers.DialogueSystem.Sequencer:HandleCommandInternally(String, String[], Single&) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Model-View-Controller/View/Sequencer/Sequencer.cs:893)
PixelCrushers.DialogueSystem.Sequencer:ActivateCommand(String, String, Transform, Transform, String[]) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Model-View-Controller/View/Sequencer/Sequencer.cs:640)
PixelCrushers.DialogueSystem.Sequencer:PlayCommand(QueuedSequencerCommand, String, Boolean, Single, String, String, String[]) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Model-View-Controller/View/Sequencer/Sequencer.cs:610)
PixelCrushers.DialogueSystem.Sequencer:PlayCommand(QueuedSequencerCommand) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Model-View-Controller/View/Sequencer/Sequencer.cs:579)
PixelCrushers.DialogueSystem.Sequencer:PlaySequence(String) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Model-View-Controller/View/Sequencer/Sequencer.cs:513)
PixelCrushers.DialogueSystem.Sequencer:PlaySequence(String, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Model-View-Controller/View/Sequencer/Sequencer.cs:523)
PixelCrushers.DialogueSystem.Sequencer:PlaySequence(String, Transform, Transform, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Model-View-Controller/View/Sequencer/Sequencer.cs:529)
PixelCrushers.DialogueSystem.DialogueSystemController:PlaySequence(String, Transform, Transform, Boolean, Boolean, String) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueSystemController.cs:1223)
PixelCrushers.DialogueSystem.DialogueSystemController:PlaySequence(String, Transform, Transform, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueSystemController.cs:1276)
PixelCrushers.DialogueSystem.DialogueSystemController:PlaySequence(String, Transform, Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueSystemController.cs:1297)
PixelCrushers.DialogueSystem.DialogueManager:PlaySequence(String, Transform, Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueManager.cs:706)
PixelCrushers.DialogueSystem.DialogueSystemTrigger:DoSequenceAction(Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Trigger Subsystem/Triggers/DialogueSystemTrigger.cs:617)
PixelCrushers.DialogueSystem.DialogueSystemTrigger:Fire(Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Trigger Subsystem/Triggers/DialogueSystemTrigger.cs:577)
PixelCrushers.DialogueSystem.DialogueSystemTrigger:TryStart(Transform, Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Trigger Subsystem/Triggers/DialogueSystemTrigger.cs:563)
PixelCrushers.DialogueSystem.DialogueSystemTrigger:TryStart(Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Trigger Subsystem/Triggers/DialogueSystemTrigger.cs:549)
PixelCrushers.DialogueSystem.DialogueSystemTrigger:OnUse(Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Trigger Subsystem/Triggers/DialogueSystemTrigger.cs:428)
UnityEngine.GameObject:BroadcastMessage(String, Object, SendMessageOptions)
PixelCrushers.DialogueSystem.Selector:UseCurrentSelection() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Trigger Subsystem/Interaction/Selector.cs:303)
PixelCrushers.DialogueSystem.Selector:Update() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Trigger Subsystem/Interaction/Selector.cs:285)
I tried adding a Canvas Group to the Parent canvas but the message was not resolved.

is there something else I need to do to get the animations to work?

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

Re: Send Open Message to UIPanel

Post by Tony Li »

Add an Animator to the panel, and assign an animator controller asset such as Dialogue System / Prefabs / Art / Animation / Canvas Group Animator / Canvas Group Animator Controller.

Or, if you don't want it to fade in & out, and you just want it to immediately appear & disappear, you can remove the Animator component and clear the UI Panel's Show Animation Trigger and Hide Animation Trigger fields.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Send Open Message to UIPanel

Post by nathanj »

Of course...

Thanks again.
Post Reply