wiki.sine.space | sinespace

Difference between revisions of "Demo Radio (Scripting)"

From wiki.sine.space
Jump to: navigation, search
Line 25: Line 25:
 
Set the UI scale mode to scale with screen size, this will scale the UI and elements dependant on the users screen resolution.
 
Set the UI scale mode to scale with screen size, this will scale the UI and elements dependant on the users screen resolution.
  
[[]]
+
[[File:Radio Demo 3.jpeg]]

Revision as of 17:42, 12 August 2019

Sinespace Radio Demo (Beginner)

In this tutorial we are going to create a radio script that allows us to play and change the streamed radio being played within a region in Sinespace. You will require a current install of Unity and our SpacePack API for this demo to work correctly Get Started.

Create a Radio Model

Firstly right click in the hierarchy and create an empty game object and set the transform to 0 0 0 and rename it to Radio Demo, this will be our container for the virtual goods component and room furniture component (more on this later), it also helps us keep our project tidy. Right click on the Radio Demo game object and create a cube and renamed it as Stream Player, this will be our radio model (you can add any model you like here).

Radio Demo 1.jpeg

While the Stream Player is selected add the following components to the game object by clicking the add component button at the bottom of the inspector :

  • Scripting runtime component (used to add scripting to a game object)
  • Shoutcast Streaming component (used to play streaming audio to the listeners)
  • Clickable Activator (Makes the game object clickable, used for the radio admin)

Create Your Radio Interface

Radio Demo 4.jpeg

Right click Radio Demo object and create a canvas and set the canvas render mode to screen space overlay, this will create a canvas in which we can add UI elements over the main screen.

Radio Demo 2.jpeg

Set the UI scale mode to scale with screen size, this will scale the UI and elements dependant on the users screen resolution.

Radio Demo 3.jpeg