Last updated
Last updated
Support us as a and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our ... become a sponsor today!
You can find a working example in the sample scenes names 7 Workshop Browser
this sample is designed to work with App 480 Spacewars and emulates the browser in Steam's Workshop UI.
The first thing you will want to do is add a to a game object related to your browser UI. This component provides the events your UI will listen on to update its display and the methods and values your UI will interact with to drive the query
Create a UI controller that can listen on the Results Changed event of the UGC Query Manager and update your UI accordingly. That is write a new script to manage your browser UI and set it up such that it can listen on the event of the manager
PSEDO CODE EXAMPLE
Once defined you can reference this in the Unity Inspector
Next you will want to connect UI controls such as a Back and Next button up so the user can iterate over the query pages.
You should do the same for "Set Previous Search Page" so that the user can go back and forth. These methods are safe and will never step to a page that doesn't exist.
Enabling search, you could do this in a few ways but the simplest is to trigger a search on the end edit of an InputField, this way when the user finished typing a search string and presses enter it will start the search.
That said it can be nice to have a Search Button that on click performed the searched using the text contained in the InputField. The choice is up to you
Whatever your choice your UI should call the SearchAll method which takes a string as an input parameters. That string is the filter string used by Valve to narrow results.
The above assumes you have a reference to your in an attribute named manager
result will be of type and contains all the details about that specific item.