35 lines
1020 B
C#
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));
|
|
}
|
|
}
|
|
} |