Skip to content

Instantly share code, notes, and snippets.

@moon-goon
Last active February 11, 2016 02:38
Show Gist options
  • Save moon-goon/c27a513a270381646f67 to your computer and use it in GitHub Desktop.
Save moon-goon/c27a513a270381646f67 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Button_Groups : MonoBehaviour {
List<Rect> lstButtonItems = new List<Rect>();
List<Rect> lstButtonSkills = new List<Rect>();
void Start () {
var width = Screen.width;
var height = Screen.height;
lstButtonSkills.Add(new Rect(width / 2 + 50, height / 2 + 333, 55, 55));
lstButtonSkills.Add(new Rect(width / 2 + 105, height / 2 + 333, 55, 55));
lstButtonSkills.Add(new Rect(width / 2 + 160, height / 2 + 333, 55, 55));
lstButtonItems.Add(new Rect(width / 2 - 160, height / 2 + 333, 55, 55));
lstButtonItems.Add(new Rect(width / 2 - 105, height / 2 + 333, 55, 55));
lstButtonItems.Add(new Rect(width / 2 - 50, height / 2 + 333, 55, 55));
}
void OnGUI() {
GUI.Button(lstButtonSkills[0], "Skill A");
GUI.Button(lstButtonSkills[1], "Skill B");
GUI.Button(lstButtonSkills[2], "Skill C");
GUI.Button(lstButtonItems[0], "Item A");
GUI.Button(lstButtonItems[1], "Item B");
GUI.Button(lstButtonItems[2], "Item C");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment