Unity learning record: Fungus plug-in-replace mouse click dialogue with keyboard control dialogue

Fungus plug-in study notes

This article is based on Unity2019.3.2f1 version, Fungus3.12.0 version

Keyboard control to start the next dialogue

When I first learned Unity dialogue, I found Fungus, a very convenient dialogue plug-in, but there are many places I don’t understand, and there are not many online tutorials. By default, Fungus uses mouse clicks or the 空格dialogue process, which means that if there is a long series of dialogues, you need to use the mouse to click multiple or 空格multiple times. This is normal, but the 空格character will jump up when pressed , which is uncomfortable.
So naturally I will try my best to modify it and use other keys to continue the conversation, but I haven't found the modification position provided by this plug-in for a long time. At most, I found a modification that the mouse click position is full screen, and the dialog box is still a button. Of course I can't give up. As a programmer, I naturally thought of changing the code. and so:

Step 1: Find the script location

sayDialog
First create a Say Dialog, not a Menu Dialog. I chose the wrong one in the picture above. Then click on the newly created Say Dialog, find the Dialog Input script hanging on it, and click once to find the location of the script.
jiaoben
After opening it Ctr+ Ftry to search Input.GetMouseButtonDown(0), and you will find a result, you can basically confirm it is here.
there
Then you can add the effect you want in the if condition, for example, I added one E.
add
There is no problem running after the modification, and everything is fine.
If you know of a better way, please let me know. Also, thank you for seeing here. 233

Guess you like

Origin blog.csdn.net/weixin_46149121/article/details/105935655