Enquiry
Here is how you can enquiry UI information. The below example is trying to get a dropdown options count info from a dropdown UI.
Last updated
Here is how you can enquiry UI information. The below example is trying to get a dropdown options count info from a dropdown UI.
Last updated
Step 1 :
Create an empty scene with any name of your liking and open the scene.
Step 2 : Adding necessary scene game objects for this exercise.
Go to the Prefabs folder inside path UIs/Essential and drag ChessGameObjectBase prefab into the scene hierachy.
Then, create a canvas and drag the dropdown prefab located inside Base folder of path Prefabs/UIs/Dropdown into the canvas. Or create a legacy dropdown of your own on the scene, the dropdown prefab is actually the same as legacy dropdown.
Step 3 :
Copy code below to ChessEnquiryManager.cs located in Scripts/Main/Communicators folder
Step 4 :
Create a C# script in the path Scripts/Main/UIs/Dropdowns named DummyDropdown.cs and copy the code below into it. The GetOptionsCount()
function is from the base class, getting the number of dropdown options currently the dropdown have.
Step 5 :
The code below can be called in any GUI script to get the number of dropdown options.