Skip to content

Commit

Permalink
Added Facebook UI and re-created script references
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Quinn committed Nov 14, 2013
1 parent 14a42d0 commit 14c90b7
Show file tree
Hide file tree
Showing 6 changed files with 638 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,46 @@ public class FacebookManager : MonoBehaviour
private bool _loggedIn = false;
private const string FacebookAuthTokenKey = "FacebookAuthToken";

GUIContent[] comboBoxList;
private ComboBox comboBoxControl;// = new ComboBox();
private GUIStyle listStyle = new GUIStyle();

void Start()
{
comboBoxList = new GUIContent[5];
comboBoxList[0] = new GUIContent("Friend 1");
comboBoxList[1] = new GUIContent("Friend 2");
comboBoxList[2] = new GUIContent("Friend 3");
comboBoxList[3] = new GUIContent("Friend 4");
comboBoxList[4] = new GUIContent("Friend 5");

listStyle.normal.textColor = Color.white;
listStyle.onHover.background =
listStyle.hover.background = new Texture2D(2, 2);
listStyle.padding.left =
listStyle.padding.right =
listStyle.padding.top =
listStyle.padding.bottom = 4;

comboBoxControl = new ComboBox(new Rect(160, 20, 100, 20), comboBoxList[0], comboBoxList, "button", "box", listStyle);
}

void OnGUI()
{
comboBoxControl.Show();

GUI.Label(new Rect(20, 20, 150, 20), "Select friend to invite : " + comboBoxControl.ButtonContent);
if (GUI.Button(new Rect(280, 20, 100, 20), "Send invite"))
{
ShowFriends();
}

if (_loggedIn)
{
if (GUI.Button(new Rect(Screen.width - 150, 50, 130, 20), "Facebook logout"))
{
Logout();
}

if (GUI.Button(new Rect(Screen.width - 150, 80, 130, 20), "Invite friend"))
{
ShowFriends();
}
}
else
{
Expand Down
Loading

0 comments on commit 14c90b7

Please sign in to comment.