Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- var besquerda;
- var bdireita;
- static function percent(vertical : boolean, percent : float) : float {
- if(vertical == true)
- return Screen.height*percent/100.0;
- else
- return Screen.width*percent/100.0;
- }
- function OnGUI() {
- if (GUI.Button(besquerda,"<"))
- Debug.Log("Esquerda");
- else if (GUI.Button(bdireita,">"))
- Debug.Log("Direita");
- }
- function Start () {
- var altura : float = percent(false,5.0);
- var largura : float = percent(true,80.0);
- besquerda = Rect (percent(false,5.0), percent(true,10.0), altura, largura);
- bdireita = Rect (percent(false,90.0), percent(true,10.0), altura, largura);
- }
- function Update () {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement