* adds Lua language support * makes the library generic, allowing for easy extension for more languages * small improvements and fixes
14 lines
345 B
Rust
14 lines
345 B
Rust
use bevy::prelude::*;
|
|
|
|
/// A component that represents a script.
|
|
#[derive(Component)]
|
|
pub struct Script<A: Asset> {
|
|
pub script: Handle<A>,
|
|
}
|
|
|
|
impl<A: Asset> Script<A> {
|
|
/// Create a new script component from a handle to a [Script] obtained using [AssetServer].
|
|
pub fn new(script: Handle<A>) -> Self {
|
|
Self { script }
|
|
}
|
|
}
|