69 lines
1.2 KiB
C#
69 lines
1.2 KiB
C#
|
using System;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace AmplifyBloom
|
||
|
{
|
||
|
[Serializable]
|
||
|
public class VersionInfo
|
||
|
{
|
||
|
public const byte Major = 1;
|
||
|
|
||
|
public const byte Minor = 1;
|
||
|
|
||
|
public const byte Release = 2;
|
||
|
|
||
|
private static string StageSuffix = "_dev001";
|
||
|
|
||
|
[SerializeField]
|
||
|
private int m_major;
|
||
|
|
||
|
[SerializeField]
|
||
|
private int m_minor;
|
||
|
|
||
|
[SerializeField]
|
||
|
private int m_release;
|
||
|
|
||
|
public int Number
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return this.m_major * 100 + this.m_minor * 10 + this.m_release;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static string StaticToString()
|
||
|
{
|
||
|
return string.Format("{0}.{1}.{2}", 1, 1, 2) + VersionInfo.StageSuffix;
|
||
|
}
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return string.Format("{0}.{1}.{2}", this.m_major, this.m_minor, this.m_release) + VersionInfo.StageSuffix;
|
||
|
}
|
||
|
|
||
|
private VersionInfo()
|
||
|
{
|
||
|
this.m_major = 1;
|
||
|
this.m_minor = 1;
|
||
|
this.m_release = 2;
|
||
|
}
|
||
|
|
||
|
private VersionInfo(byte major, byte minor, byte release)
|
||
|
{
|
||
|
this.m_major = (int)major;
|
||
|
this.m_minor = (int)minor;
|
||
|
this.m_release = (int)release;
|
||
|
}
|
||
|
|
||
|
public static VersionInfo Current()
|
||
|
{
|
||
|
return new VersionInfo(1, 1, 2);
|
||
|
}
|
||
|
|
||
|
public static bool Matches(VersionInfo version)
|
||
|
{
|
||
|
return 1 == version.m_major && 1 == version.m_minor && 2 == version.m_release;
|
||
|
}
|
||
|
}
|
||
|
}
|