Arduino Input with Dialogue System?
Arduino Input with Dialogue System?
Hi. I'm working with an Arduino to create a custom game controller and have data from it coming into Unity via serial communication. I was wondering if there's any way to connect this input to the dialogue system? I have two buttons, one I want to to choose a conversation reply, and another one selects it. Thanks!
Re: Arduino Input with Dialogue System?
Hi,
Assuming you're using Unity UI, I recommend making an input module. You could make it a subclass of StandaloneInputModule and read input from the Arduino instead of the Input class. This way you can use your Arduino with any UI, not just the Dialogue System.
If you don't want to do that, you can always write your own implementation of the Dialogue System's IDialogueUI C# interface, starting with a copy of TemplateDialogueUI.cs to get a head start. Or make subclasses of StandardUISubtitlePanel and StandardUIMenuPanel if you want to inherit all of the functionality of the Standard Dialogue UI system and just add support for Arduino input.
Assuming you're using Unity UI, I recommend making an input module. You could make it a subclass of StandaloneInputModule and read input from the Arduino instead of the Input class. This way you can use your Arduino with any UI, not just the Dialogue System.
If you don't want to do that, you can always write your own implementation of the Dialogue System's IDialogueUI C# interface, starting with a copy of TemplateDialogueUI.cs to get a head start. Or make subclasses of StandardUISubtitlePanel and StandardUIMenuPanel if you want to inherit all of the functionality of the Standard Dialogue UI system and just add support for Arduino input.