C# - Get number of references to object
问题 I'm trying to write a simple Resource Manager for the little hobby game I'm writing. One of the tasks that this resource manager needs to do is unloading unused resources. I can think of doing this in two ways: When an object no longer requires a reference to the resource, it must call a method of the Resource Manager to signify it is no longer using it; or When an object no longer requires a reference to the resource, it simply sets it to null. Then when the Resource Manager is asked to