public void AddImpulse(Vector3 eulerAngles) { if (ImpulseQueueLimit < 1 || ThrottledImpulses.Items.Count < ImpulseQueueLimit) { ThrottledImpulses.Add(eulerAngles); } }
// Usually 0.5 ~ 1.5 private void AddGunImpulse(float strength) { const int maxRecoilItems = 1; if (GunRecoilThrotter.Items.Count < maxRecoilItems) { GunRecoilThrotter.Add(-strength * 1000); } //GunRecoilSpring.AddImpulse(-strength * 1000); }
private void ReceiveStepEvent(Vector3 localDirection) { const float exteriorScale = 0.94f; const float interiorScale = 0.40f; float scale = CameraScript.IsExteriorView ? exteriorScale : interiorScale; CameraScript.AddYSpringImpulse(localDirection.z * scale); // TODO super gross wtf is wrong with me bool isStrafing = currentAnim == "strafeLeft" || currentAnim == "strafeRight"; // Don't stick more in if too many already if (FootstepThrottler.Items.Count > 1) { return; } if (localDirection.z > 0) { FootstepThrottler.Add(() => { StepSound.pitch = 0.9f; StepSound.volume = 0.18f; if (GlobalSoundsScript.soundEnabled) { StepSound.Play(); } }); } else if (!isStrafing) { FootstepThrottler.Add(() => { StepSound.volume = 0.06f; StepSound.pitch = 0.8f; if (GlobalSoundsScript.soundEnabled) { StepSound.Play(); } }); } }