Files
Cielonos/Assets/Scripts/MainGame/Characters/Base/Subcontrollers/AudioSubcontroller.cs
SoulliesOfficial ef7b479712 initial
2025-11-25 08:19:33 -05:00

35 lines
996 B
C#

using SLSFramework.WwiseAssistance;
using UnityEngine;
using Event = AK.Wwise.Event;
namespace Cielonos.MainGame.Characters
{
public class AudioSubcontroller : SubcontrollerBase<CharacterBase>
{
public AudioContainer audioContainer;
public GameObject PlayPoint(Transform overridePoint)
{
return overridePoint != null ? overridePoint.gameObject : owner.gameObject;
}
public override void Initialize()
{
base.Initialize();
audioContainer ??= owner.GetComponent<AudioContainer>();
}
public void PlayFootStepSound(AnimationEvent animationEvent)
{
if (animationEvent.animatorClipInfo.weight > 0.5f)
{
audioContainer.PlaySoundFX("FootStep", PlayPoint(owner.footPoint));
}
}
public void PlayDashSound()
{
audioContainer.PlaySoundFX("Dash", PlayPoint(owner.footPoint));
}
}
}