footstep audio added

This commit is contained in:
2024-04-09 16:45:05 +01:00
parent faa835d790
commit 44f03fd82b
12 changed files with 219 additions and 25 deletions

View File

@@ -1235,11 +1235,11 @@ retry:
instance.release();
}
public static void PlayOneShotAttached(EventReference eventReference, GameObject gameObject)
public static void PlayOneShotAttached(EventReference eventReference, GameObject gameObject, float pitch, float volume)
{
try
{
PlayOneShotAttached(eventReference.Guid, gameObject);
PlayOneShotAttached(eventReference.Guid, gameObject, pitch, volume);
}
catch (EventNotFoundException)
{
@@ -1247,11 +1247,11 @@ retry:
}
}
public static void PlayOneShotAttached(string path, GameObject gameObject)
public static void PlayOneShotAttached(string path, GameObject gameObject, float pitch, float volume)
{
try
{
PlayOneShotAttached(PathToGUID(path), gameObject);
PlayOneShotAttached(PathToGUID(path), gameObject, pitch, volume);
}
catch (EventNotFoundException)
{
@@ -1259,7 +1259,7 @@ retry:
}
}
public static void PlayOneShotAttached(FMOD.GUID guid, GameObject gameObject)
public static void PlayOneShotAttached(FMOD.GUID guid, GameObject gameObject, float pitch, float volume)
{
var instance = CreateInstance(guid);
#if UNITY_PHYSICS_EXIST
@@ -1269,6 +1269,8 @@ retry:
#else
AttachInstanceToGameObject(instance, gameObject.transform);
#endif
instance.setVolume(volume);
instance.setPitch(pitch);
instance.start();
instance.release();
}