r2mods/ilspy_dump/ror2_csproj/RoR2.WwiseUtils/StateSetter.cs

30 lines
514 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
namespace RoR2.WwiseUtils;
public struct StateSetter
{
private readonly string name;
private readonly uint id;
private uint expectedEngineValueId;
public uint valueId;
public StateSetter(string name)
{
this.name = name;
id = AkSoundEngine.GetIDFromString(name);
expectedEngineValueId = 0u;
valueId = expectedEngineValueId;
}
public void FlushIfChanged()
{
if (!expectedEngineValueId.Equals(valueId))
{
expectedEngineValueId = valueId;
AkSoundEngine.SetState(id, valueId);
}
}
}