mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-13 21:25:09 +00:00
fully functional screen shake
its a lil smooth at lower intensities but it works! lots of "complicated" "math" going on here. thanks for all the help, minenice! recommended settings - intensity: 2 length: 0.25
This commit is contained in:
parent
907af78d6a
commit
4d31dc8fe2
1 changed files with 1 additions and 1 deletions
|
@ -170,7 +170,7 @@ namespace HeavenStudio
|
||||||
EasingFunction.Function func = EasingFunction.GetEasingFunction(e.ease);
|
EasingFunction.Function func = EasingFunction.GetEasingFunction(e.ease);
|
||||||
float dx = func(positionLast.x, e.valA, Mathf.Min(prog, 1f));
|
float dx = func(positionLast.x, e.valA, Mathf.Min(prog, 1f));
|
||||||
float dy = func(positionLast.y, e.valA, Mathf.Min(prog, 1f));
|
float dy = func(positionLast.y, e.valA, Mathf.Min(prog, 1f));
|
||||||
shakeResult = new Vector3(Mathf.Sin(dx * 3.14159265f * 5f) * e.valA, Mathf.Sin(dy * 3.14159265f * 10f) * e.valA);
|
shakeResult = new Vector3(Mathf.Cos(dx * e.length * 20f) * (e.valA / 2), Mathf.Cos(dy * e.length * 30f) * (e.valA / 2));
|
||||||
|
|
||||||
}
|
}
|
||||||
if (prog > 1f)
|
if (prog > 1f)
|
||||||
|
|
Loading…
Reference in a new issue