Why didn't any answers use sizeof() instead of GetValues().Length?
return (T)Random.Range(0, sizeof(T));