|
|
|
|
|
|
[ManagerDefaultPrefab("AppManager")] |
|
|
|
public class AppSettings : Manager |
|
|
|
{ |
|
|
|
public AssetReference mSceneLevelIsland; |
|
|
|
public AssetReference mSceneDemoIsland; |
|
|
|
|
|
|
|
public enum RenderRes |
|
|
|
{ |
|
|
|
_Native, |
|
|
|
|
|
|
|
|
|
|
public static void LoadScene(string scenePath, LoadSceneMode mode = LoadSceneMode.Single) |
|
|
|
{ |
|
|
|
Debug.Log("Assets/Scripts/GameSystem/AppSettings.cs:183\n\tscenePath: " + scenePath); |
|
|
|
LoadSceneByPath(scenePath, mode); |
|
|
|
if (scenePath.Contains("demo_Island")) |
|
|
|
{ |
|
|
|
Addressables.LoadSceneAsync(Instance.mSceneDemoIsland); |
|
|
|
} |
|
|
|
else if (scenePath.Contains("level_Island")) |
|
|
|
{ |
|
|
|
Addressables.LoadSceneAsync(Instance.mSceneLevelIsland); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
LoadSceneByPath(scenePath, mode); |
|
|
|
} |
|
|
|
Debug.Log("Assets/Scripts/GameSystem/AppSettings.cs:189\n\tscenePath: " + scenePath); |
|
|
|
Application.backgroundLoadingPriority = ThreadPriority.Low; |
|
|
|
switch (mode) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
public static void LoadScene(int buildIndex, LoadSceneMode mode) |
|
|
|
{ |
|
|
|
Debug.Log("Assets/Scripts/GameSystem/AppSettings.cs:206\n\tbuildIndex: " + buildIndex); |
|
|
|
Application.backgroundLoadingPriority = ThreadPriority.Low; |
|
|
|
switch (mode) |
|
|
|
{ |
|
|
|
|
|
|
yield return loadingScreenLoading; |
|
|
|
Instance.loadingScreenObject = loadingScreenLoading.Result; |
|
|
|
DontDestroyOnLoad(Instance.loadingScreenObject); |
|
|
|
Debug.Log($"loading scene {scene} at build index {SceneUtility.GetBuildIndexByScenePath(scene)}"); |
|
|
|
SceneManager.LoadScene(scene); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
yield return loadingScreenLoading; |
|
|
|
Instance.loadingScreenObject = loadingScreenLoading.Result; |
|
|
|
DontDestroyOnLoad(Instance.loadingScreenObject); |
|
|
|
Debug.Log($"loading scene {SceneUtility.GetScenePathByBuildIndex(scene)} at build index {scene}"); |
|
|
|
SceneManager.LoadScene(scene); |
|
|
|
} |
|
|
|
|
|
|
|