Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » HELP » Help (General) » Questions about Panels & Buttons.

Questions about Panels & Buttons.

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Questions about Panels & Buttons. on Sat Feb 13, 2016 11:28 pm


Member [Lv. 0]
Member [Lv. 0]

I'm trying to take some components inside a prefav who is a Canvas, the prefav inside have two panels and, on each one of them, inside them, have 4 buttons, i want to access this buttons to try -somehow- to add the script to the OnClick() area and then, select a function, and add a variable if the function requiere it, so the questions are simple.

How exactly i can access the panels and the buttons from C#?

And then, how can i access the OnClick() selected script area of the buttons through C#?

How can i from then get the function of that script through C#?

And how i can, after that, bring a variable valu if the functin ask for it through C#?

And also:

What are exaclty at component level the panels?, i know they (i guess/heard) can't be selected like "Panels", so the question stands, whats exactly the type of component that a panel is?, it doesn't seem in the GameObject list than there is actualy a Panel type at all.

What are they?

This is what i have so far:


. . .
Canvas canvasPrefab = LoadSprite ();
canvasPrefab.name = "canvasPrefab";
Instantiate(canvasPrefab, Camera.main.transform.position, Camera.main.transform.rotation);
canvasPrefab.GetComponent (Canvas); //Not sure if this is right
. . .

Any comment, question or request for clarification will also be much apreciated.

Thanks in advance

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum