The usual way to check if a GameObject (or any other UnityEngine.Object) is destroyed is to check if it is == null. The problem is that this only works on the next frame, as Object.Destroy(obj) queues the object to be destroyed at the end of the frame.
I’m not aware of a way to check that list directly.
Solution A: you’re probably better off putting that sort of check in LateUpdate, where (I believe) the Destroy will have been completed. If you’re making this check in Update, you wouldn’t be able to rely on the execution order unless it’s forced in the project settings (which should generally be a method of last resort). (Or it’s in the same function, and you can just store a temporary variable to mark that it’s been destroyed, and you wouldn’t have this problem anyway)
Solution B: I’m guessing you need to know the status of an object that may have been destroyed by a finite number of specific scripts. If that’s the case, then you could create a static class List to track objects that were destroyed that frame; when one of those scripts calls Destroy it adds to that list, and other objects can check against that list. The list itself may get reinitialized every LateUpdate.
A simple solution would not be to call Destroy(gameObject) or Destroy(gameObject, 2) but would be to create a script that handles it…
var script = gameObject.AddComponent<DestroyScript>();
script.delay = 2;
// later on....
var script = gameObject.GetComponent<DestroyScript>();
if(script != null) Debug.Log("The game Object is set to be destroyed");
This would be a problem when you have a death animation that takes time. The object will still be there, but it shouldn’t be shot at by the AI.
In the concept where you have an AI with a trigger. Each bullet could be assigned to AI unit as the “shooter” of that bullet, so when the bullet hit something, then it calls “Damage” on the target, and then calls “HasDamaged” on the parent, passing the target. if that target then has the DestroyScript attached, then it could be removed as the target, or let the AI find another target.