-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
81 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Interfaces/ILoadSceneInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* ILoadSceneInfo.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 8/24/2022 (en-US) | ||
*/ | ||
|
||
using UnityEngine.SceneManagement; | ||
|
||
namespace MyGameDevTools.SceneLoading | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Interfaces/ISceneLoader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* ISceneLoader.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 7/16/2022 (en-US) | ||
*/ | ||
|
||
using UnityEngine.SceneManagement; | ||
|
||
namespace MyGameDevTools.SceneLoading | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Interfaces/ISceneLoaderAsync.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* ISceneLoaderAsync.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 8/15/2022 (en-US) | ||
*/ | ||
|
||
#if ENABLE_UNITASK | ||
using Cysharp.Threading.Tasks; | ||
#endif | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Interfaces/ISceneManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* ISceneManager.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2022-12-21 | ||
*/ | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
using UnityEngine.SceneManagement; | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Loading/LoadingBehavior.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadingBehavior.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 7/23/2022 (en-US) | ||
*/ | ||
|
||
using UnityEngine; | ||
|
||
namespace MyGameDevTools.SceneLoading | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Loading/LoadingFader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadingFader.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 7/23/2022 (en-US) | ||
*/ | ||
|
||
using System.Collections; | ||
using UnityEngine; | ||
|
||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Loading/LoadingFeedbackSlider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadingFeedbackSlider.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 7/23/2022 (en-US) | ||
*/ | ||
|
||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Loading/LoadingFeedbackText.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadingFeedbackText.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 7/23/2022 (en-US) | ||
*/ | ||
|
||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Loading/LoadingFeedbackTextMeshPro.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
#if ENABLE_TMP | ||
/** | ||
* LoadingFeedbackTextMeshPro.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 7/25/2022 (en-US) | ||
*/ | ||
|
||
using TMPro; | ||
using UnityEngine; | ||
|
||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Loading/LoadingProgress.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadingProgress.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2023-01-31 | ||
*/ | ||
|
||
using System; | ||
|
||
namespace MyGameDevTools.SceneLoading | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Loading/LoadingState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadingState.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2023-01-31 | ||
*/ | ||
|
||
namespace MyGameDevTools.SceneLoading | ||
{ | ||
/// <summary> | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Managers/SceneManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
#if ENABLE_UNITASK && !OVERRIDE_DISABLE_UNITASK | ||
#define USE_UNITASK | ||
#endif | ||
/** | ||
* SceneManager.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2022-12-21 | ||
*/ | ||
|
||
#if USE_UNITASK | ||
using Cysharp.Threading.Tasks; | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,6 @@ | |
#if ENABLE_UNITASK && !OVERRIDE_DISABLE_UNITASK | ||
#define USE_UNITASK | ||
#endif | ||
/** | ||
* {nameof(SceneManagerAddressable)}.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2023-01-21 | ||
*/ | ||
|
||
#if USE_UNITASK | ||
using Cysharp.Threading.Tasks; | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* SceneLoaderAsync.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 7/16/2022 (en-US) | ||
*/ | ||
|
||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
@@ -68,7 +62,11 @@ async ValueTask<Scene[]> TransitionWithIntermediateAsync(ILoadSceneInfo[] target | |
|
||
var currentScene = externalOrigin ? externalOriginScene : _manager.GetActiveScene(); | ||
|
||
#if UNITY_2023_2_OR_NEWER | ||
var loadingBehavior = Object.FindObjectsByType<LoadingBehavior>(UnityEngine.FindObjectsSortMode.None).FirstOrDefault(l => l.gameObject.scene == loadingScene); | ||
#else | ||
var loadingBehavior = Object.FindObjectsOfType<LoadingBehavior>().FirstOrDefault(l => l.gameObject.scene == loadingScene); | ||
#endif | ||
return loadingBehavior | ||
? await TransitionWithIntermediateLoadingAsync(targetScenes, setIndexActive, intermediateSceneInfo, loadingBehavior, currentScene, externalOrigin) | ||
: await TransitionWithIntermediateNoLoadingAsync(targetScenes, setIndexActive, intermediateSceneInfo, currentScene, externalOrigin); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* SceneLoaderCoroutine.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 9/4/2022 (en-US) | ||
*/ | ||
|
||
using System; | ||
using System.Collections; | ||
using System.Linq; | ||
|
@@ -77,7 +71,11 @@ IEnumerator TransitionWithIntermediateRoutine(ILoadSceneInfo[] targetScenes, int | |
|
||
var currentScene = externalOrigin ? externalOriginScene : _manager.GetActiveScene(); | ||
|
||
#if UNITY_2023_2_OR_NEWER | ||
var loadingBehavior = Object.FindObjectsByType<LoadingBehavior>(UnityEngine.FindObjectsSortMode.None).FirstOrDefault(l => l.gameObject.scene == loadingScene); | ||
#else | ||
var loadingBehavior = Object.FindObjectsOfType<LoadingBehavior>().FirstOrDefault(l => l.gameObject.scene == loadingScene); | ||
#endif | ||
yield return loadingBehavior | ||
? TransitionWithIntermediateLoadingAsync(targetScenes, setIndexActive, intermediateSceneInfo, loadingBehavior, currentScene, externalOrigin) | ||
: TransitionWithIntermediateNoLoadingAsync(targetScenes, setIndexActive, intermediateSceneInfo, currentScene, externalOrigin); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
#if ENABLE_UNITASK | ||
/** | ||
* SceneLoaderUniTask.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 8/1/2022 (en-US) | ||
*/ | ||
|
||
using Cysharp.Threading.Tasks; | ||
using System; | ||
using System.Linq; | ||
|
@@ -69,7 +63,11 @@ async UniTask<Scene[]> TransitionWithIntermediateAsync(ILoadSceneInfo[] targetSc | |
|
||
var currentScene = externalOrigin ? externalOriginScene : _manager.GetActiveScene(); | ||
|
||
#if UNITY_2023_2_OR_NEWER | ||
var loadingBehavior = Object.FindObjectsByType<LoadingBehavior>(UnityEngine.FindObjectsSortMode.None).FirstOrDefault(l => l.gameObject.scene == loadingScene); | ||
#else | ||
var loadingBehavior = Object.FindObjectsOfType<LoadingBehavior>().FirstOrDefault(l => l.gameObject.scene == loadingScene); | ||
#endif | ||
return loadingBehavior | ||
? await TransitionWithIntermediateLoadingAsync(targetScenes, setIndexActive, intermediateSceneInfo, loadingBehavior, currentScene, externalOrigin) | ||
: await TransitionWithIntermediateNoLoadingAsync(targetScenes, setIndexActive, intermediateSceneInfo, currentScene, externalOrigin); | ||
|
@@ -108,7 +106,11 @@ async UniTask UnloadCurrentScene(Scene currentScene, bool externalOrigin) | |
return; | ||
|
||
if (externalOrigin) | ||
#if UNITY_2023_2_OR_NEWER | ||
await UnityEngine.SceneManagement.SceneManager.UnloadSceneAsync(currentScene).ToUniTask(); | ||
#else | ||
await UnityEngine.SceneManagement.SceneManager.UnloadSceneAsync(currentScene); | ||
#endif | ||
else | ||
await _manager.UnloadSceneAsync(new LoadSceneInfoScene(currentScene)); | ||
} | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Structs/LoadSceneInfoAssetReference.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
#if ENABLE_ADDRESSABLES | ||
/** | ||
* LoadSceneInfoAssetReference.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2023-02-01 | ||
*/ | ||
|
||
using System; | ||
using UnityEngine.AddressableAssets; | ||
using UnityEngine.ResourceManagement.ResourceProviders; | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Structs/LoadSceneInfoIndex.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadSceneInfoIndex.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 8/24/2022 (en-US) | ||
*/ | ||
|
||
using System; | ||
using UnityEngine.SceneManagement; | ||
|
||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Structs/LoadSceneInfoName.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadSceneInfoName.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 8/24/2022 (en-US) | ||
*/ | ||
|
||
using System; | ||
using UnityEngine.SceneManagement; | ||
|
||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Structs/LoadSceneInfoScene.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadSceneInfoScene.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2022-12-21 | ||
*/ | ||
|
||
using System; | ||
using UnityEngine.SceneManagement; | ||
|
||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Utilities/RoutineBehaviour.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* RoutineBehaviour.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 9/4/2022 (en-US) | ||
*/ | ||
|
||
using UnityEngine; | ||
|
||
public class RoutineBehaviour : MonoBehaviour | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Runtime/Utilities/WaitTask.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* WaitTask.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2022-12-21 | ||
*/ | ||
|
||
using System.Collections; | ||
using System.Threading.Tasks; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadingBehaviorTests.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2023-01-31 | ||
*/ | ||
|
||
using NUnit.Framework; | ||
using System.Collections; | ||
using UnityEngine; | ||
|
@@ -16,7 +10,11 @@ public class LoadingBehaviorTests | |
[OneTimeTearDown] | ||
public void Teardown() | ||
{ | ||
#if UNITY_2023_2_OR_NEWER | ||
var behaviors = Object.FindObjectsByType<LoadingBehavior>(FindObjectsSortMode.None); | ||
#else | ||
var behaviors = Object.FindObjectsOfType<LoadingBehavior>(); | ||
#endif | ||
foreach (var b in behaviors) | ||
Object.DestroyImmediate(b.gameObject); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadingFaderTests.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2023-02-01 | ||
*/ | ||
|
||
using NUnit.Framework; | ||
using System.Collections; | ||
using UnityEngine; | ||
|
@@ -16,8 +10,13 @@ public class LoadingFaderTests | |
[OneTimeTearDown] | ||
public void Teardown() | ||
{ | ||
#if UNITY_2023_2_OR_NEWER | ||
Object.DestroyImmediate(Object.FindAnyObjectByType<LoadingBehavior>().gameObject); | ||
Object.DestroyImmediate(Object.FindAnyObjectByType<LoadingFader>().gameObject); | ||
#else | ||
Object.DestroyImmediate(Object.FindObjectOfType<LoadingBehavior>().gameObject); | ||
Object.DestroyImmediate(Object.FindObjectOfType<LoadingFader>().gameObject); | ||
#endif | ||
} | ||
|
||
[UnityTest] | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Tests/Runtime/LoadingFeedbackTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadingFeedbackTests.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2023-01-31 | ||
*/ | ||
|
||
using NUnit.Framework; | ||
using System.Collections; | ||
using UnityEngine; | ||
|
6 changes: 0 additions & 6 deletions
6
Packages/mygamedevtools-scene-loader/Tests/Runtime/LoadingProgressTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/** | ||
* LoadingProgressTests.cs | ||
* Created by: João Borks [[email protected]] | ||
* Created on: 2023-01-31 | ||
*/ | ||
|
||
using NUnit.Framework; | ||
|
||
namespace MyGameDevTools.SceneLoading.Tests | ||
|
Oops, something went wrong.