您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
25 行
699 B
25 行
699 B
using Unity.Entities;
|
|
|
|
namespace Unity.MegaCity.Streaming
|
|
{
|
|
/// <summary>
|
|
/// Check the scene sections to load and update the GameLoadInfo singleton with loaded sections number
|
|
/// </summary>
|
|
public struct GameLoadInfo : IComponentData
|
|
{
|
|
public int TotalSceneSections;
|
|
public int LoadedSceneSections;
|
|
|
|
public float GetProgress()
|
|
{
|
|
if (TotalSceneSections == 0)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
return (float)LoadedSceneSections / TotalSceneSections;
|
|
}
|
|
|
|
public bool IsLoaded => TotalSceneSections > 0 && LoadedSceneSections == TotalSceneSections;
|
|
}
|
|
}
|