Creating Buttons For IOS

Hello everyone, I am extremely new to IOS development and i wasn’t sure how to go about making buttons for my main menu screen. I did some research and saw that there are multiple ways. I would like to know the best way and how to implement it. Thanks!

Update your Unity Engine to the newest version 4.6. If you have already done so continue reading.

1). Make a new scene and call it Menu or whatever you want

2). Right click in the Hierarchy and find “UI” and choose “Button.” This will create a canvas, which is required for the new UI and the button. If you click the triangle of the button in the hierarchy, you will see a text object, you can change the button text from there.

3). Make a new empty gameObject and name it “Scripts”.

4). Make a new script and call it “ButtonControl”

5). In that script, you will write the functions you want your buttons to do example below

public void test_button (string text)
{
    print (text);
}

that code will print whatever you enter in the parameter. And you can set parameter values from inside the editor.

6). go to your button, and on the very bottom, you will see a panel that says “OnClick()”, simply click the little circle next to “none” and choose your “Scripts” object.

7). On the second drop down list, you will see all the functions. Including the ones you wrote, so pick your function. If a parameter is present, a little text box will appear underneath to enter your values. Enter it and you’re done.

Rest is easy to figure out, and you can obviously use other UI elements such as sliders, text, images etc etc. :slight_smile: