public override void Update(GameEngine engine, GameTime gameTime) { if (_firstRun) { List <Asset.Asset> assetsToLoad = AssetRegistry.GetAssetsToLoad(); AssetLoader.LoadQueue.AddAll(assetsToLoad); _totalAssetsToLoad = AssetLoader.LoadQueue.GetSize(); _currentlyLoaded = 0; _loadedEverything = _currentlyLoaded == _totalAssetsToLoad; _firstRun = false; } if (!_loadedEverything) { AssetLoader.LoadQueue.LoadNext(); _currentlyLoaded++; _loadedEverything |= _currentlyLoaded == _totalAssetsToLoad; } if (!IsAssetLoaded()) { return; } MapTileTextures.Initialise(); PlayerUnitAssets.Initialise(); engine.EnterState(StateId.Gameplay); }