您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
27 行
1007 B
27 行
1007 B
namespace Unity.Entities
|
|
{
|
|
static public class ChangeVersionUtility
|
|
{
|
|
public static bool DidChange(uint changeVersion, uint requiredVersion)
|
|
{
|
|
// When a system runs for the first time, everything is considered changed.
|
|
if (requiredVersion == 0)
|
|
return true;
|
|
// Supporting wrap around for version numbers, change must be bigger than last system run.
|
|
// (Never detect change of something the system itself changed)
|
|
return (int)(changeVersion - requiredVersion) > 0;
|
|
}
|
|
|
|
public static void IncrementGlobalSystemVersion(ref uint globalSystemVersion)
|
|
{
|
|
globalSystemVersion++;
|
|
// Handle wrap around, 0 is reserved for systems that have never run..
|
|
if (globalSystemVersion == 0)
|
|
globalSystemVersion++;
|
|
}
|
|
|
|
// 0 is reserved for systems that have never run
|
|
public const int InitialGlobalSystemVersion = 1;
|
|
|
|
}
|
|
}
|