| 1690 | } |
| 1691 | |
| 1692 | bool Level::LoadSceneAsync(const Guid& id) |
| 1693 | { |
| 1694 | if (!id.IsValid()) |
| 1695 | { |
| 1696 | Log::ArgumentException(); |
| 1697 | return true; |
| 1698 | } |
| 1699 | |
| 1700 | // Preload scene asset |
| 1701 | const auto sceneAsset = Content::LoadAsync<JsonAsset>(id); |
| 1702 | if (sceneAsset == nullptr) |
| 1703 | { |
| 1704 | LOG(Error, "Cannot load scene asset."); |
| 1705 | return true; |
| 1706 | } |
| 1707 | |
| 1708 | ScopeLock lock(_sceneActionsLocker); |
| 1709 | _sceneActions.Enqueue(New<LoadSceneAction>(id, sceneAsset, true)); |
| 1710 | |
| 1711 | return false; |
| 1712 | } |
| 1713 | |
| 1714 | bool Level::UnloadScene(Scene* scene) |
| 1715 | { |