Ads keep us online. Without them, we wouldn't exist. We don't have
paywalls or sell mods - we never will. But every month we have large bills
and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3
Step 1: First off all, you'll need to get the textures for your buttons. And also texture the YCTP to have space for the buttons.
2: Unity Step 1: Drag&Drop your textures into the Textures2D folder to add your folders to Unity
Step 2: Open the MathGame Prefab (In the "Prefab folder) and make a new GameObject Parent for your buttons
Step 3: Make a new button "UI Section" and in the Transition Dropdown select "Sprite Swap"
Step 4: In the Image Component for the Sprite select one of your button
Step 5: For the "Pressed Sprite" Select the texture for when its selected. Also do this for the Highlighted sprite
Step 6: Now Simply do this with all your buttons sprites and also position them in different
3: The OK Button
Now for this button do the same thing like you did for the others buttons but in the add a new event for the "On Click" section. Select for the GameObject the MathGame Object and in the Dropdown go to the "MathGameScript" and then select "OkButton" (You might not have this right now but we'll do this later)
Step 1: Go to the MathGameScript and then make a new void called "OKButton" and then in it simply in the code put "this.CheckAnswer();"
Step 2: Make a new script and in it make a new button variable & a text variable & a reference variable for the MathGameScript (for this tutorial it will be called "playerText". And also at the top put "using UnityEngine.Events and then put in the Start void put "this.button = GetComponent<Button>();" Step 3: Now make a new void and then in the void put this.playerText.text += this.text;
Step 4: Now in the Start void put "this.button.On Click = button.AddListener(new UnityAction("void name")); (I might be wrong with this code but if I am it's in the "Basic Button Script"
5: Finishing the OK Button
Step 1: Now go to the OKButton add a new event in the "On Click" and select the MathGame as the GameObject and then in the Dropdown select "MathGameScript" and then select "(Your void name)"