@@ -33,6 +33,11 @@ SceneAnimationPlayer::SceneAnimationPlayer(const SpawnParams& params)
|
||||
Animation.Loaded.Bind<SceneAnimationPlayer, &SceneAnimationPlayer::OnAnimationModified>(this);
|
||||
}
|
||||
|
||||
float SceneAnimationPlayer::GetTime() const
|
||||
{
|
||||
return _time;
|
||||
}
|
||||
|
||||
void SceneAnimationPlayer::SetTime(float value)
|
||||
{
|
||||
_time = value;
|
||||
@@ -137,8 +142,6 @@ void SceneAnimationPlayer::Stop()
|
||||
|
||||
void SceneAnimationPlayer::Tick(float dt)
|
||||
{
|
||||
CHECK(IsActiveInHierarchy() && _state == PlayState::Playing);
|
||||
|
||||
// Reset temporary state
|
||||
_postFxSettings.PostFxMaterials.Materials.Clear();
|
||||
_postFxSettings.CameraArtifacts.OverrideFlags &= ~CameraArtifactsSettings::Override::ScreenFadeColor;
|
||||
@@ -731,7 +734,10 @@ void SceneAnimationPlayer::Tick(SceneAnimation* anim, float time, float dt, int3
|
||||
}
|
||||
|
||||
// Keep playing
|
||||
audioSource->Play();
|
||||
if (_state == PlayState::Playing)
|
||||
audioSource->Play();
|
||||
else
|
||||
audioSource->Pause();
|
||||
}
|
||||
else if (audioSource)
|
||||
{
|
||||
@@ -871,7 +877,7 @@ void SceneAnimationPlayer::Tick(SceneAnimation* anim, float time, float dt, int3
|
||||
}
|
||||
else
|
||||
{
|
||||
*(MonoObject**)value = (MonoObject*)boxed;
|
||||
*(MonoObject**)value = boxed;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -158,11 +158,7 @@ public:
|
||||
/// Gets the current animation playback time position (seconds).
|
||||
/// </summary>
|
||||
/// <returns>The animation playback time position (seconds).</returns>
|
||||
API_PROPERTY(Attributes="NoSerialize, HideInEditor")
|
||||
FORCE_INLINE float GetTime() const
|
||||
{
|
||||
return _time;
|
||||
}
|
||||
API_PROPERTY(Attributes="NoSerialize, HideInEditor") float GetTime() const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the current animation playback time position (seconds).
|
||||
|
||||
@@ -134,17 +134,13 @@ void AudioSource::Play()
|
||||
void AudioSource::Pause()
|
||||
{
|
||||
if (_state != States::Playing)
|
||||
{
|
||||
LOG(Warning, "Cannot pause audio source that is not playing ({0})", GetNamePath());
|
||||
return;
|
||||
}
|
||||
|
||||
_state = States::Paused;
|
||||
|
||||
if (_isActuallyPlayingSth)
|
||||
{
|
||||
AudioBackend::Source::Pause(this);
|
||||
|
||||
_isActuallyPlayingSth = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user