// Use this for initialization void Start() { GameObject go = GameObject.Find("SpacebrewObject"); // the name of your client object sbClient = go.GetComponent <SpacebrewClient> (); //GameObject hook = GameObject.Find ("SpacebrewObject"); // the name of your client object // 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, "launchSatellite"); //sbClient.addEventListener (this.gameObject, "lightOn"); //sbClient.addEventListener (this.gameObject, "letters"); sbClient.addEventListener(this.gameObject, "Julius_Up"); sbClient.addEventListener(this.gameObject, "Julius_Down"); sbClient.addEventListener(this.gameObject, "Julius_Right"); sbClient.addEventListener(this.gameObject, "Julius_Left"); sbClient.addEventListener(this.gameObject, "Julius_Line"); sbClient.addEventListener(this.gameObject, "Micol_Up"); sbClient.addEventListener(this.gameObject, "Micol_Down"); sbClient.addEventListener(this.gameObject, "Micol_Right"); sbClient.addEventListener(this.gameObject, "Micol_Left"); sbClient.addEventListener(this.gameObject, "Micol_Line"); }
// 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, "mystring"); }
private void Awake() { sbClient = gameObject.GetComponentInParent <SpacebrewClient>(); if (sbClient == null) { throw new Exception("SpacebrewEvent: SpacebrewClient not found in parent object!"); } clientConfigs = new List <Config>(); routeTable = new Dictionary <string, ClientRoutes>(); }
void Start() { sbClient = gameObject.GetComponentInParent <SpacebrewClient>(); if (sbClient == null) { throw new Exception("SpacebrewEvent: SpacebrewClient not found in parent object!"); } /* * foreach (SpacebrewClient.Subscriber subscriber in sbClient.subscribers) { * print("Adding subscriber: " + subscriber.name); * sbClient.addEventListener(this.gameObject, subscriber.name); * } */ }