diff options
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); + } + } +} |