Unity Integration 2.02
The following are defined in the FMODUnity namespace:
Automatic Bank loading options used by the RuntimeManger.
enum BankLoadType
{
All,
Specified,
None
}
When using localization or DLC, the order in which Banks are loaded can be important.
See Also: Dialogue and Localization
The Unity Events used by the Studio Event Emitter, Global ParameterTrigger and Parameter Trigger components.
enum EmitterGameEvent : int
{
None,
ObjectStart,
ObjectDestroy,
TriggerEnter,
TriggerExit,
TriggerEnter2D,
TriggerExit2D,
CollisionEnter,
CollisionExit,
CollisionEnter2D,
CollisionExit2D,
ObjectEnable,
ObjectDisable,
ObjectMouseEnter,
ObjectMouseExit,
ObjectMouseDown,
ObjectMouseUp,
UIMouseEnter,
UIMouseExit,
UIMouseDown,
UIMouseUp
}
See Also: IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler
Class used by the StudioParameterTrigger for StudioEventEmitter and Parameter info.
class EmitterRef
{
public StudioEventEmitter Target;
public ParamRef[] Params;
}
See Also: StudioEventEmitter, ParamRef
Different ways to link an Event to an EventReference.
enum EventLinkage
{
Path,
GUID,
}
Holds a reference to an FMOD Studio event.
At runtime only the event's GUID is stored, as this is the most efficient way to look up an event. In the editor, the event's path is stored as well, to enable a more user-friendly UI.
[Serializable]
public struct EventReference
{
public FMOD.GUID Guid;
#if UNITY_EDITOR
public string Path;
public static Func<string, FMOD.GUID> GuidLookupDelegate;
public override string ToString()
{
return string.Format("{0} ({1})", Guid, Path);
}
public bool IsNull
{
get
{
return string.IsNullOrEmpty(Path) && Guid.IsNull;
}
}
public static EventReference Find(string path)
{
if (GuidLookupDelegate == null)
{
throw new InvalidOperationException("EventReference.Find called before EventManager was initialized");
}
return new EventReference { Path = path, Guid = GuidLookupDelegate(path) };
}
#else
public override string ToString()
{
return Guid.ToString();
}
public bool IsNull
{
get
{
return Guid.IsNull;
}
}
#endif
}
Finds an event by path and returns an EventReference that points to it. Only defined in the editor.
To define a default value for an EventReference field, call Find from your MonoBehaviour's Reset method:
#if UNITY_EDITOR
void Reset()
{
eventReference = FMODUnity.EventReference.Find("event:/music/music");
}
#endif
Path lookups only succeed if the strings bank is loaded.
Ways to import Banks into the project.
enum ImportType
{
StreamingAssets,
AssetBundle,
}
See Also: AssetBundles & Addressables
The Unity Events used by the Bank Loader component.
enum LoaderGameEvent : int
{
None,
ObjectStart,
ObjectDestroy,
TriggerEnter,
TriggerExit,
TriggerEnter2D,
TriggerExit2D,
ObjectEnable,
ObjectDisable,
}
Corresponds to the Metering Channel Order in FMOD Studio.
enum MeterChannelOrderingType
{
Standard,
SeparateLFE,
Positional
}
See Also: Metering Channel Order.
Class used to store important Parameter information.
class ParamRef
{
public string Name;
public float Value;
public FMOD.Studio.PARAMETER_ID ID;
}
ParamRef is used by various classes in the integration, such as RuntimeManager, RuntimeManager, and StudioEventEmitter, to cache retrieved Parameter information that is being used by those classes.
ParamRef can also be used as an attribute on string properties to hold the path of a Global Parameter. For more information, see the Global Parameters section of the Scripting API Reference.
While both can be used to store a reference to their respective objects, ParamRef cannot be assigned via the Unity Inspector window in the same manner that EventReference can be. This is because FMOD for Unity generates and stores cached editor-only data for events based on your FMOD Studio project's banks, but does not do the same for parameters.
See Also: FMOD_STUDIO_PARAMETER_ID.
Enum for different thread affinities.
[Flags]
public enum ThreadAffinity : uint
{
Any = 0,
Core0 = 1 << 0,
Core1 = 1 << 1,
Core2 = 1 << 2,
Core3 = 1 << 3,
Core4 = 1 << 4,
Core5 = 1 << 5,
Core6 = 1 << 6,
Core7 = 1 << 7,
Core8 = 1 << 8,
Core9 = 1 << 9,
Core10 = 1 << 10,
Core11 = 1 << 11,
Core12 = 1 << 12,
Core13 = 1 << 13,
Core14 = 1 << 14,
Core15 = 1 << 15,
}
See Also: FMOD_THREAD_TYPE, Threads and Thread Safety, FMOD Thread Types
Class for mapping the affinity of a group of thread types.
[Serializable]
public class ThreadAffinityGroup
{
public List<ThreadType> threads = new List<ThreadType>();
public ThreadAffinity affinity = ThreadAffinity.Any;
public ThreadAffinityGroup()
{
}
public ThreadAffinityGroup(ThreadAffinityGroup other)
{
threads = new List<ThreadType>(other.threads);
affinity = other.affinity;
}
public ThreadAffinityGroup(ThreadAffinity affinity, params ThreadType[] threads)
{
this.threads = new List<ThreadType>(threads);
this.affinity = affinity;
}
}
See Also: ThreadAffinity, ThreadType, FMOD_THREAD_TYPE, Threads and Thread Safety, FMOD Thread Types
Enum for various thread types.
public enum ThreadType
{
Mixer,
Feeder,
Stream,
File,
Nonblocking,
Record,
Geometry,
Profiler,
Studio_Update,
Studio_Load_Bank,
Studio_Load_Sample,
Convolution_1,
Convolution_2,
}
See Also: FMOD_THREAD_TYPE, Threads and Thread Safety, FMOD Thread Types