Slide 14
Slide 14 text
1. We are going to want to use the Spacebrew Prefab. Drag the prefab into the
scene
2. Configure the Prefab by selecting it, and bringing up the Property Inspector.
3. Set the server address to be the address you set your server to run. By default,
Spacebrew runs on port 9000. You need the “ws” in the address, it would not
work without it, although you will get a warning that mentions this will be
deprecated in future versions of the SDK
4. For this example, we want Unity to publish an event, and to listen to that same
event
5. Under the Publishers section, change the Pub Type to be STRING, and change its
name to be “button_pressed”.
6. Under the Subscribers section, change the Sub type to be STRING and change its
name to be “button_pressed”.
7. Now, the SpacebrewClient.cs will take care of connecting, and configuring it so
that we can publish and subscribe to this property channel. You can open up that
file and take a look to see what it is doing – if you add more publish properties or
subscription properties, it will just dynamically take what was entered in the
properties panel and do the work of configuring for you.
8. SpacebrewEvents.cs is the file we can see how it references the prefab,and
13