Files
Cielonos/Assets/Scripts/MainGame/Characters/Base/Subcontrollers/AudioSubcontroller.cs
SoulliesOfficial 50ee502684 完善
2026-02-13 09:22:11 -05:00

35 lines
1020 B
C#

using SLSUtilities.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.bodyPartsSc.footPoint));
}
}
public void PlayDashSound()
{
audioContainer.PlaySoundFX("Dash", PlayPoint(owner.bodyPartsSc.footPoint));
}
}
}