UnityUtils.cs 446 B

1234567891011121314151617181920
  1. using System;
  2. using System.Linq;
  3. using UnityEngine;
  4. namespace Packages.Rider.Editor.Util
  5. {
  6. public static class UnityUtils
  7. {
  8. internal static readonly string UnityApplicationVersion = Application.unityVersion;
  9. public static Version UnityVersion
  10. {
  11. get
  12. {
  13. var ver = UnityApplicationVersion.Split(".".ToCharArray()).Take(2).Aggregate((a, b) => a + "." + b);
  14. return new Version(ver);
  15. }
  16. }
  17. }
  18. }