Uni.camera Shake _top_ -
shakeDuration = duration; shakeMagnitude = magnitude; StartCoroutine(DoShake());
elapsed += Time.deltaTime; yield return null; transform.localPosition = originalPos; transform.localRotation = originalRot; uni.camera shake
void Start()
using UnityEngine; using System.Collections; public class UniCameraShake : MonoBehaviour shakeDuration = duration
float elapsed = 0f; while (elapsed < shakeDuration) Vector3 randomOffset = Random.insideUnitSphere * shakeMagnitude; transform.localPosition = originalPos + randomOffset; shakeMagnitude = magnitude
IEnumerator DoShake()