Skip to content

Instantly share code, notes, and snippets.

@digitallysavvy
Last active July 15, 2019 21:25
Show Gist options
  • Save digitallysavvy/5258d9c643dfe9de3862382e546569ff to your computer and use it in GitHub Desktop.
Save digitallysavvy/5258d9c643dfe9de3862382e546569ff to your computer and use it in GitHub Desktop.
public void OnButtonClick()
{
Debug.Log("Button Clicked: " + name);
// determin which button
if (name.CompareTo("JoinButton") == 0)
{
// join chat
OnJoinButtonClicked();
}
else if (name.CompareTo("LeaveButton") == 0)
{
// leave chat
OnLeaveButtonClicked();
}
}
private void OnJoinButtonClicked()
{
Debug.Log("Join button clicked");
// get channel name from text input
GameObject go = GameObject.Find("ChannelName");
InputField input = go.GetComponent<InputField>();
}
private void OnLeaveButtonClicked()
{
Debug.Log("Leave button clicked");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment