refactor: Remove Loadable, optional onLoads (#1333)

This commit is contained in:
Pasha Stetsenko
2022-01-24 14:23:12 -08:00
committed by GitHub
parent 00619f8047
commit 05f7a4c3d6
85 changed files with 101 additions and 157 deletions

View File

@ -14,7 +14,6 @@ class SpritebatchLoadExample extends FlameGame {
@override
Future<void> onLoad() async {
await super.onLoad();
add(MySpriteBatchComponent());
}
}
@ -23,7 +22,6 @@ class MySpriteBatchComponent extends SpriteBatchComponent
with HasGameRef<SpritebatchLoadExample> {
@override
Future<void> onLoad() async {
await super.onLoad();
final spriteBatch = await gameRef.loadSpriteBatch('boom.png');
this.spriteBatch = spriteBatch;