using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraShakeRequester : MonoBehaviour { [SerializeField] private bool shakeOnSpawn; [SerializeField] private float duration = 0.2f; [SerializeField] private float magnitude = 0.05f; CameraFollow cameraFollow; private void Awake() { cameraFollow = Camera.main.GetComponent(); } private void Start() { if (shakeOnSpawn) RequestScreenShake(); } public void RequestScreenShake() { cameraFollow.Shake(0.2f, magnitude); } }