publicvoid Initialize() { // Load asset from Resources asynchronously. This method call will immediately return without blocking. mySprites.Load("sprites", SpriteSheetAsset.SheetType.SpriteSheet, RB.AssetSource.ResourcesAsync);
// Sprite grid can be set before the sprite sheet is loaded mySprites.grid = newSpriteGrid(newVector2i(16, 16)); }
publicvoid Update() { // If the asset is not ready yet then draw loading progress bar and return // In a more complete example you may want to check for RB.AssetStatus.Failed as well if (mySprites.status != RB.AssetStatus.Ready) { /// Draw a loading progress bar RB.DrawRectFill(newRect2i(4, 4, (int)(mySprites.progress * 100), 16), Color.white); return; }