Skip to content

Commit

Permalink
accessing variables not work
Browse files Browse the repository at this point in the history
  • Loading branch information
zwazel committed Nov 15, 2023
1 parent 59ac562 commit c282ada
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/rhai/wrappers_rhai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ use bevy_script_api::rhai::{
// Even though we are implementing Clone we are still able to reference the original data in script thanks to the script wrapper we are about to implement
// Debug is nice to have, we can forward that implementation to Lua's ToString via our macro
#[derive(Resource, Reflect, Default, Clone, Debug)]
#[reflect(Resource)]
#[reflect(Resource, RhaiProxyable)]
pub struct MyThing {
usize: usize,
string: String,
array: Vec<usize>,
}

impl RhaiCopy for MyThing {}

impl MyThing {
pub fn do_something_cool(&self) -> String {
self.string.clone()
Expand Down

0 comments on commit c282ada

Please sign in to comment.