using UnityEngine; using System.Collections; public class LogTimeWhenDestroyed : MonoBehaviour { float startTime; void Awake() { startTime = Time.time; } void OnDestroy() { AVDebug.Log(name+" lived for "+(Time.time - startTime)); } }