You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
951 B

using Entitas;
namespace CoreGame.Render
{
public class CameraShakeSystem : IExecuteSystem
{
public void Execute(float deltaTime)
{
var shakeEntity = Contexts.Combat.cameraShakeEntity;
if (shakeEntity == null)
return;
var shake = shakeEntity.cameraShake;
shake.timeAcc += deltaTime;
if (shake.timeAcc > shake.duration)
{
shakeEntity.RemoveCameraShake();
return;
}
// var fixedSignal = SyncAssetLoader.GetAssetObject<CinemachineFixedSignal>("CritShake", shake.path);
//
// if (fixedSignal == null)
// {
// shakeEntity.RemoveCameraShake();
// return;
// }
// fixedSignal.GetSignal(shake.timeAcc, out var pos, out var rot);
// shake.offset = pos;
}
}
}