(Feat) Add Animation Fps Charater
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "FootstepSoundsDataAsset.h"
|
||||
|
||||
USoundBase* FFootstepSurfaceSounds::GetStepSound(EFootstepGait Gait) const
|
||||
{
|
||||
switch (Gait)
|
||||
{
|
||||
case EFootstepGait::Walk: return WalkStep;
|
||||
case EFootstepGait::Jog: return JogStep;
|
||||
case EFootstepGait::Run: return RunStep;
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
USoundBase* FFootstepSurfaceSounds::GetStopSound(EFootstepGait Gait) const
|
||||
{
|
||||
switch (Gait)
|
||||
{
|
||||
case EFootstepGait::Walk: return WalkStop;
|
||||
case EFootstepGait::Jog: return JogStop;
|
||||
case EFootstepGait::Run: return RunStop;
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
const FFootstepSurfaceSounds& UFootstepSoundsDataAsset::GetSurfaceSounds(EPhysicalSurface Surface) const
|
||||
{
|
||||
// Find et pas FindRef : on rend une reference sur l'entree de la table, sans
|
||||
// copier les huit pointeurs a chaque pas.
|
||||
if (const FFootstepSurfaceSounds* Found = Surfaces.Find(Surface))
|
||||
{
|
||||
return *Found;
|
||||
}
|
||||
|
||||
return DefaultSurface;
|
||||
}
|
||||
Reference in New Issue
Block a user