Our new developer documentation is now available. Please check it out!
OdinHandler
public class OdinHandler : MonoBehaviour
Discussion
Properties
Name | Type | Description |
---|---|---|
HasConnections | Boolean | True if any Room is joined |
Microphone | MicrophoneReader | Unity Component that handles one Microphone where data gets routed through (n) Media |
Rooms | RoomCollection | |
OnRoomJoin | RoomJoinProxy | Called before an actual room join |
OnRoomJoined | RoomJoinedProxy | Called after a room is joined successfully |
OnRoomLeave | RoomLeaveProxy | Called before a room leave |
OnRoomLeft | RoomLeftProxy | Called after a room is destroyed |
OnPeerJoined | PeerJoinedProxy | Called on every Peer that joins the room(s) we're connected to |
OnPeerUserDataChanged | PeerUserDataChangedProxy | Called on every Peer that updates his UserData in the same room(s) |
OnPeerLeft | PeerLeftProxy | Called on every Peer that left in the same room(s) |
OnMediaAdded | MediaAddedProxy | Called on every Peer that created a media in the same room(s) |
OnMediaRemoved | MediaRemovedProxy | Called on every Peer that closed/destroyed one of his own media in the same room(s) |
OnMediaActiveStateChanged | MediaActiveStateChangedProxy | Called on every activity change of a media in the same room(s) |
OnRoomUserDataChanged | RoomUserDataChangedProxy | Called on the Room that updates his UserData |
OnMessageReceived | MessageReceivedProxy | Called on every Peer that received message from a peer by UInt64%5b%5d%2cSystem |
OnConnectionStateChanged | ConnectionStateChangedProxy | Called on the Room that changed the connection state |
OnCreatedMediaObject | UnityCreatedMediaObject | Called if this OdinHandler created a MediaStream that was requested by the MediaQueue |
OnDeleteMediaObject | UnityDeleteMediaObject | Called if this OdinHandler destroyed a MediaStream that was closed by a remote peer and was requested by the MediaQueue |
UnityAudioSourceTag | String | Identify |
Use3DAudio | Boolean | Enable 3D Audio via preset Odin |
CreatePlayback | Boolean | Creates Room_OnMediaAdded(System events |
PlaybackAudioMixer | AudioMixer | |
PlaybackAudioMixerGroup | AudioMixerGroup |
Static Properties
Name | Type | Description |
---|---|---|
Config | OdinEditorConfig | Static reference to the global Unity |
Instance | OdinHandler | Singleton reference to this OdinHandler |
Public Methods
Name | Description |
---|---|
GetUserData | |
JoinRoom | Join or create a room by name and attach a Media |
LeaveRoom | Leave and free the Room by name |
AddPlaybackComponent | Tries to identifiy a gameobject by tag to assign the PlaybackComponent |
GetOrCreateMicrophoneStream | Returns the attached Audio |
RoomsSetPositionScale | Configures the allowed 'view' distance for proximity calculation of peers in each room |
RoomsUpdatePosition | Updates the two-dimensional position of our own peer in each room |
UpdateUserData | Updates the Rooms |
GetRoom | Gets the room object from Odin |
GetPeer | Gets the a Peer object from a specified room matching a peer ID |
GetMedia | Get the PlaybackStream of a peer in the room |
GetPeers | Get all remote peers inside a room |
BroadcastMessage | Sends arbitrary data to a all remote peers in all rooms |
GetPlaybackComponents | Gets all Audio across all rooms |
GetPlaybackComponent | Gets a Audio |
DestroyPlaybackComponents | Destroys all Audio instances |