[Completed] Enhance component `Display Panel Closer` to support closing by input/button

Justus

Member
There is a simple panel closer component which could help us close a panel by click its background:
- Display Panel Closer
1651837422220.png

Sometimes we need similar behavior which could be only triggered by a button, or both be triggered by a button.

For example, I want to use UICancel button(button B in XBOX controller) to close Item Action Panel, and it only close Action Panel,not close other panel.
then I hope have such a `Display Panel Closer` allow me to bind button B to close this specific panel.

My request is: enhance or add a component to support following feature.
- indicate a panel, close it by a button( a input)
- the `close by clicking background` and `close by input` feature could be enable/disabled independantly.
- (optional) maybe a component named `Display Panel Opener` which allow us indicate Display Panel reference and bind to a input is also a very cool utility.
 
I've added your request, but if I were you I would probably create new scripts for that. You'll have more control over where the input comes from and how it is processed.


You can already define a input to open/toggle a panel:
1651838682362.png
 

Attachments

  • DisplayPanelCloser.cs
    3.1 KB · Views: 0
That should do, I made tiny change but it should do the trick
 

Attachments

  • DisplayPanelCloser.cs
    3.1 KB · Views: 2
Top