void Start()

float elapsed = 0f; while (elapsed < shakeDuration) Vector3 randomOffset = Random.insideUnitSphere * shakeMagnitude; transform.localPosition = originalPos + randomOffset;

Vector3 randomRot = Random.insideUnitSphere * shakeMagnitude; transform.localRotation = originalRot * Quaternion.Euler(randomRot);

using UnityEngine; using System.Collections; public class UniCameraShake : MonoBehaviour

public void Shake(float duration, float magnitude)

IEnumerator DoShake()