版本
menu_open
Wwise Unity Integration Documentation
Wwise Types

Wwise Types 表示 Wwise 中的核心对象类的集合,如 SoundBank、Event、Game Parameter、State 和 Switch。每个类都有一个关联的属性抽屉,可以让用户轻松地选择所需的对象。Wwise Type 还包含一个支持类,其代表可在发送 Event 时发送到声音引擎的回调标记。

下面是一个示例脚本,它使用了一些 Wwise Types:

public class WwiseTypesExample : UnityEngine.MonoBehaviour
{
public AK.Wwise.Bank MyBank = null;
public AK.Wwise.Event MyEvent = null;
public AK.Wwise.RTPC MyRTPC = null;
public void Awake()
{
MyBank.Load();
}
public void Start()
{
MyEvent.Post(gameObject);
}
private float CalculateMyValue()
{
return (float)System.Math.Sin(System.Math.PI * UnityEngine.Time.timeSinceLevelLoad);
}
public void Update()
{
MyRTPC.SetValue(gameObject, CalculateMyValue());
}
}

以上脚本自动生成下面的 inspector:

为了使用 marker 回调,可以对 WwiseTypesExample 类做如下的更改:

public AK.Wwise.CallbackFlags MyCallbackFlags = null;
public void Start()
{
MyEvent.Post(gameObject, MyCallbackFlags, EventCallback);
}
private void EventCallback(object cookie, AkCallbackType type, AkCallbackInfo info)
{
if (type == AkCallbackType.AK_Marker)
{
var markerInfo = info as AkMarkerCallbackInfo;
if (markerInfo != null)
{
// ...
}
}
}
This type can be used to set game parameter values to the sound engine.
Definition: AkWwiseRtpc.cs:25
Definition: AkWwiseAcousticTexture.cs:21
This type can be used to post Events to the sound engine.
Definition: AkWwiseEvent.cs:29
Definition: AkWwiseAcousticTexture.cs:21
This type can be used to load/unload SoundBanks.
Definition: AkWwiseBank.cs:29
This type represents the values of the flags used when posting an Event with a callback.
Definition: AkWwiseCallbackFlags.cs:25

此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅