static float GetUnityVersionMajorMinor() {
float result = 5.4f;
string version = Application.unityVersion;
if (!string.IsNullOrEmpty(version)) {
int dotIndex = version.IndexOf('.');
if (dotIndex > 0 && version.Length > dotIndex + 1) {
if (!float.TryParse(version.Substring(0, dotIndex + 2), out result)) {
result = 5.4f;
}
}
}
return result;
}