Create initial reflection system

This commit is contained in:
Werner
2021-12-23 08:46:30 -03:00
parent aa549e37ef
commit 19eebb4085
10 changed files with 174 additions and 0 deletions

32
Source/Examples/mod.rs Normal file
View File

@ -0,0 +1,32 @@
use crate::*;
#[derive(Reflect)]
pub struct Foo {
#[property(visible, editable, category = "Default")]
pub a: u32,
#[property(visible, editable, category = "Default")]
pub b: Bar,
#[property(visible, editable, category = "Default")]
pub c: Vec<u128>,
#[property(visible, editable, category = "Default")]
pub d: Vec<Bar>,
}
impl Foo {
#[function(callable, category = "Default")]
pub fn Func(&mut self) {}
}
#[derive(Reflect)]
pub struct Bar {
#[property(visible, editable, category = "Default")]
pub value: f32,
}
impl Bar {
#[function(callable, category = "Default")]
pub fn Func(&mut self) {}
}