From 6ce8b9e22fc13be34b442c7b6af48b42cd44275a Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Wed, 13 Mar 2024 11:00:58 +0800 Subject: +init --- AmplifyOcclusion/VersionInfo.cs | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 AmplifyOcclusion/VersionInfo.cs (limited to 'AmplifyOcclusion/VersionInfo.cs') diff --git a/AmplifyOcclusion/VersionInfo.cs b/AmplifyOcclusion/VersionInfo.cs new file mode 100644 index 0000000..c460b70 --- /dev/null +++ b/AmplifyOcclusion/VersionInfo.cs @@ -0,0 +1,61 @@ +using System; +using UnityEngine; + +namespace AmplifyOcclusion; + +[Serializable] +public class VersionInfo +{ + public const byte Major = 1; + + public const byte Minor = 2; + + public const byte Release = 3; + + private static string StageSuffix = "_dev001"; + + [SerializeField] + private int m_major; + + [SerializeField] + private int m_minor; + + [SerializeField] + private int m_release; + + public int Number => m_major * 100 + m_minor * 10 + m_release; + + private VersionInfo() + { + m_major = 1; + m_minor = 2; + m_release = 3; + } + + private VersionInfo(byte major, byte minor, byte release) + { + m_major = major; + m_minor = minor; + m_release = release; + } + + public static string StaticToString() + { + return $"{(byte)1}.{(byte)2}.{(byte)3}" + StageSuffix; + } + + public override string ToString() + { + return $"{m_major}.{m_minor}.{m_release}" + StageSuffix; + } + + public static VersionInfo Current() + { + return new VersionInfo(1, 2, 3); + } + + public static bool Matches(VersionInfo version) + { + return version.m_major == 1 && version.m_minor == 2 && 3 == version.m_release; + } +} -- cgit v1.1-26-g67d0