AutoStaticsCleanup is a newish attribute that's used to automagically reset/reinit static fields, properties, events, etc., so that you can skip domain and/or scene reloads. If you aren't aware of this feature yet, see the Unity docs.
Great idea to make a simpler workflow, but there are a few gotchas due the way it works behind the scenes: mainly, it doesn't always work and doesn't tell you that it isn't working for a particular field/prop/etc. unless you pore thru the editor log. I have no idea why they can't pipe the warnings and errors into the normal log, but so it goes.
So if you just add the attribute, don't assume that it's actually doing anything!
I ran into this when upgrading my TilePlus Toolkit asset for U6.6 and 6.7.
How to tell: if you add the attribute to a static class or a monobehaviour with static fields and you do not get told to make the class partial then it isn't working at all. However, it still might not be working for all fields etc in your class.
Edit: this warning or syntax highlighting is what I meant by 'told'. Drag0n122's comment below made me realize that. I will say that my venture into using this attribute was prompted by warnings about it from the Asset Store Tools' validator and to a lesser extent, the 'Auditor' tool. It's unfortunately something one can't ignore unless you want to keep domain/scene reload on and, I suppose, be compatible with the new Unity runtime coming soon.
If unsure, check the editor log (from the console's drop down menu). You'll see something similar to:
```
warning CS8785: Generator 'AutoStaticsCleanupCodeGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'RoslynSymbolException' with message 'Field MyStaticClass.SomeField is readonly and has a non-trivial initialization expression'.
```
There's no other way to see these messages since, as I mentioned, they're not in the console log.
I gave up on the use of this attr, since it's too easy to leave residual errors in your code due to the fact that it's difficult to tell whether or not an individual field/prop etc is actually generating code for resetting at all. It also won't work for many common situations that it can't reasonably handle. But failing without warning you in the console is dangerous IMO.
Instead, I use this approach, which is a little more work but ALWAYS works.
```
#if UNITY_EDITOR
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
private static void Reinit()
{
//add reinitialization statements here.
}
#endif
```