LogTimeWhenDestroyed.cs 250 B

12345678910111213141516171819
  1. using UnityEngine;
  2. using System.Collections;
  3. public class LogTimeWhenDestroyed : MonoBehaviour
  4. {
  5. float startTime;
  6. void Awake()
  7. {
  8. startTime = Time.time;
  9. }
  10. void OnDestroy()
  11. {
  12. AVDebug.Log(name+" lived for "+(Time.time - startTime));
  13. }
  14. }