浏览代码

[Bot] Automated dotnet-format update

/main
Unknown 4 年前
当前提交
db2b3ac2
共有 1 个文件被更改,包括 33 次插入33 次删除
  1. 66
      UOP1_Project/Assets/Scripts/LocationLoader.cs

66
UOP1_Project/Assets/Scripts/LocationLoader.cs


//The load event we are listening to
[SerializeField] private LoadEvent _loadEvent = default;
//List of the scenes to load and track progress
private List<AsyncOperation> _scenesToLoadAsyncOperations = new List<AsyncOperation>();
//List of scenes to unload
private List<Scene> _ScenesToUnload = new List<Scene>();
//List of the scenes to load and track progress
private List<AsyncOperation> _scenesToLoadAsyncOperations = new List<AsyncOperation>();
//List of scenes to unload
private List<Scene> _ScenesToUnload = new List<Scene>();
//Keep track of the scene we want to set as active (for lighting/skybox)
private GameScene _activeScene;

//Unload the scenes
UnloadScenes();
}
}
public void AddScenesToUnload()
{
if (SceneManager.sceneCount > 0)
{
for (int i = 0; i < SceneManager.sceneCount; ++i)
{
Scene scene = SceneManager.GetSceneAt(i);
if (scene.name != "ScenesLoader")
{
Debug.Log("Added scene to unload = " + scene.name);
//Add the scene to the list of the scenes to unload
_ScenesToUnload.Add(scene);
}
}
}
}
public void AddScenesToUnload()
{
if (SceneManager.sceneCount > 0)
{
for (int i = 0; i < SceneManager.sceneCount; ++i)
{
Scene scene = SceneManager.GetSceneAt(i);
if (scene.name != "ScenesLoader")
{
Debug.Log("Added scene to unload = " + scene.name);
//Add the scene to the list of the scenes to unload
_ScenesToUnload.Add(scene);
}
}
}
}
public void UnloadScenes()
{

/// <summary> This function update loading progress </summary>
IEnumerator TrackLoadingProgress()
{
float totalProgress = 0;
//When the scene reaches 0.9f, it means that it is loaded
//The remaining 0.1f are for the integration
while (totalProgress <= 0.9f)
{
IEnumerator TrackLoadingProgress()
{
float totalProgress = 0;
//When the scene reaches 0.9f, it means that it is loaded
//The remaining 0.1f are for the integration
while (totalProgress <= 0.9f)
{
//Reset the progress for the new values
totalProgress = 0;
//Iterate through all the scenes to load

//the fillAmount for all scenes, so we devide the progress by the number of scenes to load
loadingProgressBar.fillAmount = totalProgress / _scenesToLoadAsyncOperations.Count;
Debug.Log("progress bar" + loadingProgressBar.fillAmount + "and value =" + totalProgress / _scenesToLoadAsyncOperations.Count);
yield return null;
}
yield return null;
}
//Clear the scenes to load
_scenesToLoadAsyncOperations.Clear();

}
}
public void ExitGame()
{

正在加载...
取消
保存