Resonance Audio Unity SDK API Reference

ResonanceAudioMaterialMapper Class Reference

ResonanceAudioMaterialMapper

Resonance Audio material mapper scriptable object that holds the mapping from GUIDs to surface materials (which define the acoustic characteristics of surfaces).

Summary

The GUID identifies either a Unity Material (which gives a mesh its visual appearance) of a game object or the terrain data of a terrain object.

Inheritance

Inherits from: ScriptableObject

Public functions

ApplyMaterialMapping(MeshRenderer[] meshRenderers, List< string >[] guidsForMeshRenderers, Terrain[] activeTerrains, string[] guidsForTerrains, Shader surfaceMaterialShader)
void
Applies the material mapping to acoustic meshes generated from mesh renderes and terrains.
GetIncludedAcousticMeshes()
Gets all acoustic meshes that should be included in a reverb computation.
GetTerrainData(string guid)
TerrainData
Gets the terrain data mapped from a GUID.
GetUnityMaterial(string guid)
Material
Gets the Unity Material mapped from a GUID.
Initialize()
void
Initializes the data members.
RenderAcousticMeshes()
void
Renders all acoustic meshes that are included.

Public functions

ApplyMaterialMapping

void ApplyMaterialMapping(
  MeshRenderer[] meshRenderers,
  List< string >[] guidsForMeshRenderers,
  Terrain[] activeTerrains,
  string[] guidsForTerrains,
  Shader surfaceMaterialShader
)

Applies the material mapping to acoustic meshes generated from mesh renderes and terrains.

GetIncludedAcousticMeshes

List< ResonanceAudioAcousticMesh > GetIncludedAcousticMeshes()

Gets all acoustic meshes that should be included in a reverb computation.

GetTerrainData

TerrainData GetTerrainData(
  string guid
)

Gets the terrain data mapped from a GUID.

Returns null if a mapping cannot be found in the currently loaded scenes.

GetUnityMaterial

Material GetUnityMaterial(
  string guid
)

Gets the Unity Material mapped from a GUID.

Returns null if a mapping cannot be found in the currently loaded scenes.

Initialize

void Initialize()

Initializes the data members.

RenderAcousticMeshes

void RenderAcousticMeshes()

Renders all acoustic meshes that are included.