예제 #1
0
        private UnityHeader(string headerFilename)
        {
            HeaderFilename = headerFilename;
            var bits = headerFilename.Replace(".h", "").Split("-");

            MetadataVersion = double.Parse(bits[0]);
            MinVersion      = new UnityVersion(bits[1]);
            if (bits.Length == 2)
            {
                MaxVersion = MinVersion;
            }
            else if (bits[2] != "")
            {
                MaxVersion = new UnityVersion(bits[2]);
            }
        }
예제 #2
0
 // Determine if this header supports the given version of Unity
 public bool Contains(UnityVersion version) => version.CompareTo(MinVersion) >= 0 && (MaxVersion == null || version.CompareTo(MaxVersion) <= 0);
예제 #3
0
 // Get the API header file which supports the given version of Unity
 public static UnityResource GetAPIHeaderForVersion(UnityVersion version) => GetAllAPIHeaders().First(r => r.VersionRange.Contains(version));
예제 #4
0
 public static UnityHeader GetHeaderForVersion(UnityVersion version) => GetAllHeaders().Where(v => v.Contains(version)).First();
예제 #5
0
 // Get the headers which support the given version of Unity
 public static UnityHeaders GetHeadersForVersion(UnityVersion version) =>
 new UnityHeaders(GetTypeHeaderForVersion(version), GetAPIHeaderForVersion(version));