-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathASSWwiseGameObj.cs
More file actions
46 lines (38 loc) · 1.11 KB
/
ASSWwiseGameObj.cs
File metadata and controls
46 lines (38 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Adds Wwise AkGameObj. Part of AudioSystemSwitcher.
*
* Use this instead of AkGameObj.
* Using regular AkGameObj would cause errors, if Wwise plugin is not installed.
*
* IsRoomAware feature untested.
*
* Supports only default listener.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ASSWwiseGameObj : MonoBehaviour
{
#if !NO_WWISE
[SerializeField] bool IsEnvironmentAware = true;
[SerializeField] bool ApplyPositionOffset = false;
[SerializeField] bool IsRoomAware = false;
[SerializeField] Vector3 positionOffset = Vector3.zero;
void Awake()
{
AkGameObj gameObj = gameObject.AddComponent<AkGameObj>();
if(IsRoomAware)
{
gameObject.AddComponent<AkRoomAwareObject>();
}
gameObj.isEnvironmentAware = IsEnvironmentAware;
if(ApplyPositionOffset)
{
gameObj.m_positionOffsetData.positionOffset = positionOffset;
}
else
{
gameObj.m_positionOffsetData = null;
}
}
#endif
}