Skip to main content
Version: 2.x

Namespace OdinNative.Unity

Classes

OdinBanner

OdinCrypto

Wrapper class of OdinNative.Wrapper.Crypto for Unity.

This convenient class provides predefined encryption helper functions for Unity. If Peers do not have the same cipher they can not communicate with each other besides some events.

OdinDecoder

Wrapper class of OdinNative.Wrapper.MediaDecoder for Unity (requires AudioSource)

This convenient class provides predefined helper functions to cover default use cases where the voice chat needs to work with AudioSource, AudioClip, AudioMixer, ...

Default Unity GameObject altering functions:

OdinEncoder

Freestanding encoder component that captures audio from an OdinNative.Unity.OdinEncoder.AudioProvider and sends it to an OdinNative.Unity.OdinRoom.

Place this anywhere in the scene. Assign OdinNative.Unity.OdinEncoder.Room and optionally an OdinNative.Unity.OdinEncoder.AudioProvider (OdinNative.Unity.Audio.OdinMicrophoneReader or OdinNative.Unity.Audio.OdinAudioReader). Audio can also be pushed manually via OdinNative.Unity.OdinEncoder.PushAudio(System.Single[],System.Int32,System.Boolean) wired through an Inspector UnityEvent or called directly.

Default behaviour:

OdinPeer

Wrapper class of OdinNative.Wrapper.PeerEntity for Unity

This convenient class provides dispatching of events to Unity with passthrough UnityEngine.Events.UnityEvent as well as predefined helper functions to cover default use cases where the voice chat is visually and logically represented by Unity gameobjects that are manageable with the Unity editor.

Default Unity GameObject altering event callback functions:

  • OdinNative.Unity.OdinPeer.Peer_DecoderAdded(System.Object,OdinNative.Unity.Events.DecoderAddedEventArgs) Creates GameObject with OdinNative.Unity.OdinDecoder component and attach media
  • OdinNative.Unity.OdinPeer.Peer_DecoderRemoved(System.Object,OdinNative.Unity.Events.DecoderRemovedEventArgs) Destroy GameObject with OdinNative.Unity.OdinDecoder component

OdinRoom

Wrapper class of OdinNative.Wrapper.Room.Room for Unity.

This convenient class provides dispatching of events to Unity with passthrough UnityEngine.Events.UnityEvent as well as predefined helper functions to cover default use cases where the voice chat is visually and logically represented by Unity gameobjects that are manageable with the Unity editor like Context menu, Inspector and/or Hierarchy window.

Default Unity GameObject altering event callback functions:

  • OdinNative.Unity.OdinRoom.PeerJoinedCreateComponent(System.Object,OdinNative.Wrapper.Room.PeerJoinedEventArgs) Creates GameObject with OdinNative.Unity.OdinPeer component
  • OdinNative.Unity.OdinRoom.PeerLeftRemoveComponent(System.Object,OdinNative.Wrapper.Room.PeerLeftEventArgs) Destroy GameObject with OdinNative.Unity.OdinPeer component
  • OdinNative.Unity.OdinRoom.RoomStatusState(System.Object,OdinNative.Wrapper.Room.RoomStateChangedEventArgs) Destroy this components GameObject if the connection is closed i.e cleanup

OdinSocket

Wrapper class of OdinNative.Wrapper.Socket.Socket for Unity

This convenient class provides dispatching of events to Unity with passthrough UnityEngine.Events.UnityEvent
as well as predefined helper functions to cover default use cases.