Skip to content

A convenient way to edit and compare version numbers according to the Semantic Versioning 2.0.0 specification. Also includes a property drawer for Unity.

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

Artees/Unity-SemVer

Repository files navigation

Unity SemVer

openupm

A convenient way to edit and compare version numbers according to the Semantic Versioning 2.0.0 specification. Also includes a property drawer for Unity.

Property drawer

Installation

Install the package games.artees.semver using my package registry. Or install via the OpenUPM registry.

Usage

Use the Artees.UnitySemVer.SemVer class or apply the Artees.UnitySemVer.SemVerAttribute attribute to a string field.

public SemVer version = new SemVer {major = 1, minor = 2, patch = 3};
[SemVer] public string versionString = "1.2.3";

Parsing:

var version = SemVer.Parse("2.0.0-rc.1+build.123");

Comparing:

Debug.Log("2.1.0"  > version);

Validating:

var result = version.Validate();
version = result.Corrected;
foreach (var message in result.Errors)
{
    Debug.LogWarning(message);
}

About

A convenient way to edit and compare version numbers according to the Semantic Versioning 2.0.0 specification. Also includes a property drawer for Unity.

Topics

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Packages

No packages published

Languages