diff options
author | chai <215380520@qq.com> | 2024-03-13 11:00:58 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2024-03-13 11:00:58 +0800 |
commit | 6ce8b9e22fc13be34b442c7b6af48b42cd44275a (patch) | |
tree | b38119d2acf0a982cb67e381f146924b9bfc3b3f /AddScreenShake.cs |
+init
Diffstat (limited to 'AddScreenShake.cs')
-rw-r--r-- | AddScreenShake.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/AddScreenShake.cs b/AddScreenShake.cs new file mode 100644 index 0000000..1d7a2a4 --- /dev/null +++ b/AddScreenShake.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +public class AddScreenShake : MonoBehaviour +{ + public float friction = 0.75f; + + public Vector3 shake = Vector2.zero; + + public Vector3 additionalRandom = Vector3.zero; + + [HideInInspector] + public WobbleShake wobbleShake; + + private void Start() + { + } + + private void Update() + { + } + + public void DoShake() + { + if ((bool)wobbleShake) + { + wobbleShake.AddShake(new Vector3(shake.x + Random.Range(0f - additionalRandom.x, additionalRandom.x), shake.y + Random.Range(0f - additionalRandom.y, additionalRandom.y), shake.z + Random.Range(0f - additionalRandom.z, additionalRandom.z)), friction); + } + } +} |