DisableToDestroy.cs 165 B

12345678910
  1. using System;
  2. using UnityEngine;
  3. public class DisableToDestroy : MonoBehaviour
  4. {
  5. public void OnDisable()
  6. {
  7. UnityEngine.Object.Destroy(base.gameObject);
  8. }
  9. }