Skip to content

Instantly share code, notes, and snippets.

View codefionn's full-sized avatar

Fionn Langhans codefionn

View GitHub Profile
@codefionn
codefionn / bevy_asset_lua.rs
Created June 5, 2022 19:46
Use Lua as an Bevy-Engine asset
use bevy::asset::{AssetLoader, BoxedFuture, LoadContext, LoadedAsset};
use mlua::prelude::*;
use std::marker::PhantomData;
pub trait LuaFile: Sized {
fn new(lua: std::sync::Mutex<Lua>) -> Self;
}
/// Loads Text as an asset