Bundle class abstract
Bundles let you spawn a fixed set of components with one call. Bevy's
equivalent of the Bundle trait.
class PlayerBundle extends Bundle {
const PlayerBundle({required this.position});
final Position position;
@override
Iterable<Component> get components => [position, const Player()];
}
world.spawn().insertBundle(const PlayerBundle(position: Position(0, 0)));
Constructors
- Bundle()
-
const
Properties
-
components
→ Iterable<
Component> -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited