Hello,
I've bought dialogue system manager a long time ago, but decided to using it now. I totally newbs btw,
So I have a question,
I want to hide the continue button so I go to next dialogue only with mouse input (left click) or keyboard (space) instead.
How to make this possible?
Thank you
Change Continue button with left click mouse
Change Continue button with left click mouse
- Attachments
-
- raysift.JPG (27.07 KiB) Viewed 940 times
Re: Change Continue button with left click mouse
Hi,
Assuming you're using Unity UI, set the continue button color's alpha to zero so it's invisible.
If you're using keyboard/gamepad navigation, tick the Unity UI Dialogue UI component's Auto Focus checkbox.
Otherwise, add a UI Button Key Trigger component to the button, and set the Key to Space and the Button to Fire1 (assuming Fire1 is mapped to the left mouse click). If you don't want to set the Button to Fire1, you can add a second UI Button Key Trigger and set the Key to MouseButton0.
Assuming you're using Unity UI, set the continue button color's alpha to zero so it's invisible.
If you're using keyboard/gamepad navigation, tick the Unity UI Dialogue UI component's Auto Focus checkbox.
Otherwise, add a UI Button Key Trigger component to the button, and set the Key to Space and the Button to Fire1 (assuming Fire1 is mapped to the left mouse click). If you don't want to set the Button to Fire1, you can add a second UI Button Key Trigger and set the Key to MouseButton0.
Re: Change Continue button with left click mouse
Hello Tony, thank you for your fast answer.
Like you thought, using UI Button is work. But if I click other button, it still keep me to next dialogue.
How to make it keep on the same dialogue even I click other button (For example save button)?
Like you thought, using UI Button is work. But if I click other button, it still keep me to next dialogue.
How to make it keep on the same dialogue even I click other button (For example save button)?
Re: Change Continue button with left click mouse
Ah, no problem, I already solved it,
Just added new condition to the script :
bool overOtherButton = EventSystem.current.currentSelectedGameObject != null &&
EventSystem.current.currentSelectedGameObject.GetComponent<UnityEngine.UI.Button>() != null &&
EventSystem.current.currentSelectedGameObject.GetComponent<UnityEngine.UI.Button>() != button;
if(!overButton){
...
Thank you for your help Toni, Cheers....
Just added new condition to the script :
bool overOtherButton = EventSystem.current.currentSelectedGameObject != null &&
EventSystem.current.currentSelectedGameObject.GetComponent<UnityEngine.UI.Button>() != null &&
EventSystem.current.currentSelectedGameObject.GetComponent<UnityEngine.UI.Button>() != button;
if(!overButton){
...
Thank you for your help Toni, Cheers....
Re: Change Continue button with left click mouse
Hi,
Happy to help! I'm glad you got it working with that bit of code.
Happy to help! I'm glad you got it working with that bit of code.