Add slow motion and make bobbing framerate-independent
This commit is contained in:
parent
007653eb54
commit
f6c0796f31
@ -27,7 +27,7 @@ namespace Saltosion.OneWeapon.Effects {
|
||||
if (CurrentBobbingState <= 0) {
|
||||
BobbingSpeed = (BobbingLaunchSpeed / 10);
|
||||
}
|
||||
CurrentBobbingState += BobbingSpeed * BobbingMultiplier;
|
||||
CurrentBobbingState += BobbingSpeed * BobbingMultiplier * Time.deltaTime * 100.0f;
|
||||
|
||||
BobbedTransform.localPosition = BobbingDirection * CurrentBobbingState * BobbingMultiplier;
|
||||
|
||||
|
@ -25,6 +25,7 @@ namespace Saltosion.OneWeapon.Effects {
|
||||
private void Update() {
|
||||
if (TimeStopCooldown > 0) {
|
||||
TimeStopCooldown -= Time.deltaTime / Time.timeScale;
|
||||
|
||||
if (TimeStopCooldown <= 0) {
|
||||
Time.timeScale = 1.0f;
|
||||
}
|
||||
@ -42,7 +43,12 @@ namespace Saltosion.OneWeapon.Effects {
|
||||
}
|
||||
|
||||
public void StopFor(float seconds) {
|
||||
Time.timeScale = 0.05f;
|
||||
Time.timeScale = 0.01f;
|
||||
TimeStopCooldown = seconds;
|
||||
}
|
||||
|
||||
public void SlowMotion(float timeScale, float seconds) {
|
||||
Time.timeScale = timeScale;
|
||||
TimeStopCooldown = seconds;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user