Created
July 24, 2014 22:05
-
-
Save bitchwhocodes/e71c1f18d159e9ba23c0 to your computer and use it in GitHub Desktop.
SpacebrewEvents.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class SpacebrewEvents : MonoBehaviour { | |
SpacebrewClient sbClient; | |
// Use this for initialization | |
void Start () { | |
GameObject go = GameObject.Find ("SpacebrewObject"); // the name of your client object | |
sbClient = go.GetComponent <SpacebrewClient> (); | |
// register an event with the client and a callback function here. | |
// COMMON GOTCHA: THIS MUST MATCH THE NAME VALUE YOU TYPED IN THE EDITOR!! | |
sbClient.addEventListener(this.gameObject, "button_pressed"); | |
} | |
public void OnSpacebrewEvent(SpacebrewClient.SpacebrewMessage _msg) { | |
GameObject.Find("subscribeText").guiText.text = _msg.value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment