Using delegates with multiple instances of a class

I understand delegates fairly well, but I’m sort of in a crunch right now and I don’t have a whole lot of time to experiment.

My question is: if I have a manager class that has a delegate in it that stores several methods from multiple instances with the same class, will a specific instance be able to take itself out of that delegate?

public class DelegatedClass : MonoBehavior {
     void Awake() {
          refOfManager.theDelegate += this.SomeMethod;
     }

     void SomeMethod() {
          Debug.Log("My ID: " + GetInstanceID());
     }

     void OnDestroy() {
          refOfManager.theDelegate -= this.SomeMethod;
     }
}

When this class is destroyed, the pointer to this specific instance of the class should be taken out of the delegate right, or am I just wrong and the delegate works as a stack with First In, Last Out?

Your boldface statement is correct. C# Delegates know which objects are unsubscribing. Unity won’t necessarily complain about lost instances that become garbage though, and can eventually accumulate and leak, so always be tidy! I typically use OnDisable() for my catch-all unsubscriptions, but afaik there’s no reason to avoid OnDestroy() for that purpose.

Thank you so much.