DestroyFixer.cs 325 B

123456789101112131415
  1. using UnityEngine;
  2. namespace SuppressTransformDestroy.Managed
  3. {
  4. public static class DestroyFixer
  5. {
  6. public static void DestroyCustomImmediate(ref Object obj)
  7. {
  8. if (!(obj is Transform t) || t.gameObject == null)
  9. return;
  10. obj = t.gameObject;
  11. }
  12. }
  13. }