I created my menu and everything, but im really bad at scripting in JS and C#. So if anyone could write up a code or a bit of code that will make things easier for me that wold be great.
Also I wanted to include a red background for the text so when dpad down is pressed the red box/background goes down to the next text. <---- Im only worried about my first question for now, but this would also save me a bit of time.
A few hints :
-Maintain a list of items (your menu entries).
-Maintain the current selection index (your item red background box)
-In the OnGui() callback, draw your menu and the selected item (with GUI.Label(), GUI.DrawTexture()…)
-In the Update() callback, check your dpad and increment or decrement your current selection index (Don’t forget the wrapping )
With D-Pad, it’s axis-based control so there is no button down or button up. You’d have to either
Create a polling and keeping current and previous d-pad state by yourself, to simulate button down/up function
Or use coroutine when getting axis input, so there is some delay between pressing a d-pad, and holding one direction won’t end up in cursor moving so fast like crazy