浏览代码

Fixes to example, moved files in Examples folder

/main
Ciro Continisio 4 年前
当前提交
c1fe908d
共有 21 个文件被更改,包括 1086 次插入30 次删除
  1. 23
      UOP1_Project/Assets/Scenes/Locations/Beach.unity
  2. 24
      UOP1_Project/Assets/Scripts/SceneManagement/LocationLoader.cs
  3. 8
      UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample.meta
  4. 1001
      UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/MultiLoadingScene.unity
  5. 7
      UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/MultiLoadingScene.unity.meta
  6. 8
      UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData.meta
  7. 8
      UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test01.asset.meta
  8. 8
      UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test02.asset.meta
  9. 8
      UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test03.asset.meta
  10. 7
      UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_01.unity.meta
  11. 7
      UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_02.unity.meta
  12. 7
      UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_03.unity.meta
  13. 0
      /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test01.asset
  14. 0
      /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test02.asset
  15. 0
      /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test03.asset
  16. 0
      /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_01.unity
  17. 0
      /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_02.unity
  18. 0
      /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_03.unity

23
UOP1_Project/Assets/Scenes/Locations/Beach.unity
文件差异内容过多而无法显示
查看文件

24
UOP1_Project/Assets/Scripts/SceneManagement/LocationLoader.cs


{
[Header("Initialization Scene")]
[SerializeField] private GameSceneSO _initializationScene = default;
[Header("Loading Screen")]
[SerializeField] private GameObject _loadingInterface = default;
[SerializeField] private Image _loadingProgressBar = default;

[SerializeField] private LoadEventChannelSO _loadEventChannel = default;
//List of the scenes to load and track progress
//List of scenes to unload
//Keep track of the scene we want to set as active (for lighting/skybox)
private GameSceneSO _activeScene;
private GameSceneSO _activeScene; // The scene we want to set as active (for lighting/skybox)
private Coroutine runningLoader = null;

/// <param name="showLoadingScreen"></param>
private void LoadScenes(GameSceneSO[] locationsToLoad, bool showLoadingScreen)
{
// Index 0 is the main scene to load and activate by default
// Add all current open scenes to unload list
// Unload the scenes
// Show the progress bar and track progress if loadScreen is true
_loadingInterface.SetActive(true);
}

string currentSceneName = locationsToLoad[i].sceneName;
if (IsSceneLoaded(currentSceneName) == false)
{
//Add the scene to the list of scenes to load asynchronously in the background
if(runningLoader == null)
{
_scenesToLoadAsyncOperations.Add(SceneManager.LoadSceneAsync(currentSceneName, LoadSceneMode.Additive));

if (scene.name != _initializationScene.sceneName && scene.name != _activeScene.name)
{
Debug.Log("Added scene to unload = " + scene.name);
//Add the scene to the list of the scenes to unload
_scenesToUnload.Add(scene);
}
}

private IEnumerator TrackLoadingProgress(GameSceneSO sceneReference)
{
float totalProgress = 0;
//When the scene reaches 0.9f, it means that it is loaded
//The remaining 0.1f are for the integration
// When the scene reaches 0.9f, it means that it is loaded
// The remaining 0.1f are for the integration
//Reset the progress for the new values
//Iterate through all the scenes to load
//Adding the scene progress to the total progress
//The fillAmount for all scenes, so we devide the progress by the number of scenes to load
//The fillAmount is for all scenes, so we divide 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);

//Clear the scenes to load
_scenesToLoadAsyncOperations.Clear();
runningLoader = null;

8
UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample.meta


fileFormatVersion: 2
guid: 3b1c2544e599a634ea09627dd05ef60e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/MultiLoadingScene.unity
文件差异内容过多而无法显示
查看文件

7
UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/MultiLoadingScene.unity.meta


fileFormatVersion: 2
guid: a3c48fffff43f5d40b06369346c43309
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData.meta


fileFormatVersion: 2
guid: 840a4d69d9860194699abe5fac89248d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test01.asset.meta


fileFormatVersion: 2
guid: 9d23d08f8b0ec194180d9d8e0a55c7c8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

8
UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test02.asset.meta


fileFormatVersion: 2
guid: 32b8629dca00d844fb292462434cfe85
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

8
UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test03.asset.meta


fileFormatVersion: 2
guid: 336d0da9155ac5f4b814fa29f3d66ae5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

7
UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_01.unity.meta


fileFormatVersion: 2
guid: 77ab3eaf737d2364a95cff0c147f24c2
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

7
UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_02.unity.meta


fileFormatVersion: 2
guid: 1f367db9e9a4e7a41bcdd51e6e0b1557
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

7
UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_03.unity.meta


fileFormatVersion: 2
guid: de16b4558b8e48b4b89f9d654f3977d3
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

/UOP1_Project/Assets/ScriptableObjects/SceneData/Locations/Test01.asset → /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test01.asset

/UOP1_Project/Assets/ScriptableObjects/SceneData/Locations/Test02.asset → /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test02.asset

/UOP1_Project/Assets/ScriptableObjects/SceneData/Locations/Test03.asset → /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/SceneData/Test03.asset

/UOP1_Project/Assets/Scenes/MultiSceneLoader/TestScene_01.unity → /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_01.unity

/UOP1_Project/Assets/Scenes/MultiSceneLoader/TestScene_02.unity → /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_02.unity

/UOP1_Project/Assets/Scenes/MultiSceneLoader/TestScene_03.unity → /UOP1_Project/Assets/Scenes/Examples/MultiSceneLoaderExample/TestScene_03.unity

正在加载...
取消
保存