浏览代码

change scene loading

/main/AdressableSceneStreaming/NoAutoStreaming
zhi.chen@unity3d.com 3 年前
当前提交
582ad29f
共有 5 个文件被更改,包括 67 次插入12 次删除
  1. 14
      Assets/AddressableAssetsData/AddressableAssetSettings.asset
  2. 30
      Assets/Resources/AppManager.prefab
  3. 21
      Assets/Scripts/GameSystem/AppSettings.cs
  4. 8
      ProjectSettings/EditorBuildSettings.asset
  5. 6
      ProjectSettings/ProjectSettings.asset

14
Assets/AddressableAssetsData/AddressableAssetSettings.asset


m_Name: AddressableAssetSettings
m_EditorClassIdentifier:
m_DefaultGroup: ae971df5c2b654af9a3670c7d1a6fc27
m_OptimizeCatalogSize: 0
m_BundleLocalCatalog: 0
m_CatalogRequestsTimeout: 0
m_IgnoreUnsupportedFilesInBuild: 0
m_NonRecursiveBuilding: 0
m_maxConcurrentWebRequests: 500
m_ContiguousBundles: 0
m_ShaderBundleNaming: 0
m_ShaderBundleCustomNaming:
m_MonoScriptBundleNaming: 0
m_MonoScriptBundleCustomNaming:
m_ContentStateBuildPath:
m_overridePlayerVersion:
m_GroupAssets:
- {fileID: 11400000, guid: 283cfc36cc7e3476c947ddc708efef12, type: 2}

- {fileID: 11400000, guid: 8092aa13f89a049a185fbb3e2e152534, type: 2}
- {fileID: 11400000, guid: 5e24b560f19099247bc7d0cfeda3807c, type: 2}
- {fileID: 11400000, guid: ce07084a329a84a49ba4ab6ee2b8d49f, type: 2}
m_BuildSettings:
m_CompileScriptsInVirtualMode: 0
m_CleanupStreamingAssetsAfterBuilds: 1

30
Assets/Resources/AppManager.prefab


m_Script: {fileID: 11500000, guid: 6de62f03c3364421389a6c95485ec756, type: 3}
m_Name:
m_EditorClassIdentifier:
mSceneLevelIsland:
m_AssetGUID: e49366a21c3d84388bfb33016c0e77e2
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
mSceneDemoIsland:
m_AssetGUID: b3bf1324da98a41e796a5881dd3812eb
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
maxRenderSize: 3
variableResolution: 0
axisBias: 0.5

loadingScreen:
m_AssetGUID: 179a2376fe443449d9046bc913164c8b
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
m_SubObjectType:
m_EditorAssetChanged: 0
--- !u!114 &8490184438857729681
MonoBehaviour:
m_ObjectHideFlags: 0

boatPrefab:
m_AssetGUID: 405c4bc591de844a3a100e1538790229
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
livery:
primaryColor: {r: 0.8773585, g: 0.09518514, b: 0.09518514, a: 0}
trimColor: {r: 0.8679245, g: 0.8679245, b: 0.8679245, a: 0}

m_AssetGUID: 70d78230a0527e74dabc4f14906eef98
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
livery:
primaryColor: {r: 0.11053756, g: 0.8679245, b: 0.17524286, a: 0}
trimColor: {r: 0.7354654, g: 0.122774996, b: 0.8396226, a: 0}

m_AssetGUID: 405c4bc591de844a3a100e1538790229
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
livery:
primaryColor: {r: 0.098039225, g: 0.8980392, b: 0.8708881, a: 0}
trimColor: {r: 0.14150941, g: 0.14150941, b: 0.14150941, a: 0}

m_AssetGUID: 70d78230a0527e74dabc4f14906eef98
m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
livery:
primaryColor: {r: 0.1481844, g: 0.2092964, b: 0.8490566, a: 0}
trimColor: {r: 0.9339623, g: 0.7163166, b: 0.074893214, a: 0}

m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
m_SubObjectType:
m_EditorAssetChanged: 0
m_SubObjectType:
m_EditorAssetChanged: 0
m_SubObjectType:
m_EditorAssetChanged: 0
--- !u!114 &7312333174115242941
MonoBehaviour:
m_ObjectHideFlags: 0

21
Assets/Scripts/GameSystem/AppSettings.cs


[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);
}

8
ProjectSettings/EditorBuildSettings.asset


- enabled: 1
path: Assets/scenes/main_menu.unity
guid: c817c1b09586c49e5b4a849ce1cf119b
- enabled: 1
path: Assets/scenes/_levels/level_Island.unity
guid: e49366a21c3d84388bfb33016c0e77e2
- enabled: 1
- enabled: 0
- enabled: 0
path: Assets/scenes/_levels/level_Island.unity
guid: e49366a21c3d84388bfb33016c0e77e2
m_configObjects:
com.unity.addressableassets: {fileID: 11400000, guid: 3f119a19757f84dac85ee298b9dd65d3,
type: 2}

6
ProjectSettings/ProjectSettings.asset


hideHomeButton: 0
submitAnalytics: 1
usePlayerLog: 1
autoStreaming: 1
autoStreaming: 0
useAnimationStreaming: 0
useFontStreaming: 0
autoStreamingId: /v1/buckets//release_by_badge//content/AS%252F

Others: 1
bundleVersion: 0.9
preloadedAssets:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}

m_APIs: 02000000
m_Automatic: 0
- m_BuildTarget: AndroidPlayer
m_APIs: 150000000b000000
m_APIs: 0b000000
m_Automatic: 0
- m_BuildTarget: MacStandaloneSupport
m_APIs: 10000000

正在加载...
取消
保存