| | |
| | | EPlayMode playMode; |
| | | if (!AssetSource.isUseAssetBundle) |
| | | { |
| | | #if UNITY_EDITOR |
| | | // Editor 不使用 AB 模式:EditorSimulateMode 直接读 AssetDatabase |
| | | playMode = EPlayMode.EditorSimulateMode; |
| | | #else |
| | | playMode = EPlayMode.OfflinePlayMode; |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | #if UNITY_EDITOR |
| | | // 编辑器下 AB 模式使用 OfflinePlayMode(随包模式),从 StreamingAssets 加载 |
| | | #if UNITY_WEBGL |
| | | // WebGL 平台(含 Editor 下切到 WebGL target):BuildInFileSystem 不支持 WebGL,必须用 WebPlayMode |
| | | playMode = EPlayMode.WebPlayMode; |
| | | #elif UNITY_EDITOR |
| | | // Editor 非 WebGL target + AB 模式:从本地 StreamingAssets 加载已构建的 AB |
| | | playMode = EPlayMode.OfflinePlayMode; |
| | | #else |
| | | playMode = EPlayMode.HostPlayMode; |
| | | // 其他平台 AB 模式 |
| | | playMode = EPlayMode.OfflinePlayMode; |
| | | #endif |
| | | } |
| | | |