To compiler dev team: In the future, can you please do the following at the beginning of C# scripts:
using UnityEngine;
using System; // <- need this to throw and catch useful exceptions
using System.Collections.Generic; // <- need this for almost-not-braindead containers
Instead of:
using UnityEngine;
using System.Collections; // <- USELESS!
because I’m finding that I have to change this for every file the editor creates. I’d use VS macros, except they have a tendency to be buggy.
using System; // <- need this to throw and catch useful exceptions
If you did this, anytime you used Random, you’d need to differentiate between System.Random and UnityEngine.Random, which would confuse a lot of people, trust me. You don’t technically ever need “using System” in any case, just prepend System where necessary. (e.g. System.Exception instead of Exception.)
using System.Collections; // <- USELESS!
It’s far from useless; you use it for IEnumerator (coroutines). Without it you could do “System.Collections.IEnumerator” instead, but again, not having it by default would confuse far too many people. The only thing I’d agree with is importing System.Collections.Generic as standard, but as PlanetTimmy mentions, you can always change the template yourself.
FWIW I don’t think there’s any issue with using both System.Collections and System.Collections.Generic in the same file. When you use IEnumerator, if you use it without generic arguments then you get the coroutine-compatible version from System.Collections, and if you use it with generic arguments then you get the generics-compatible version from System.Collections.Generic.
Also useful to get rid of the ultra-annoying “You are using two different carriage return types” error message. Changing those files is the first thing I do every time I upgrade Unity.