using System.Collections; using UnityEngine; public sealed class DestroyProbe : MonoBehaviour { [SerializeField] private GameObject target; private IEnumerator Start() { if (target == null || target == gameObject) { Debug.LogError("Assign a separate target object.", this); yield break; } GameObject wrapper = target; Destroy(target); yield return null; Debug.Log("Unity null: " + (wrapper == null), this); Debug.Log("Managed null: " + object.ReferenceEquals(wrapper, null), this); } }