mirror of
https://github.com/guilhermewerner/reflection
synced 2025-06-16 05:34:17 +00:00
Create initial reflection system
This commit is contained in:
32
Source/Examples/mod.rs
Normal file
32
Source/Examples/mod.rs
Normal 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) {}
|
||||
}
|
Reference in New Issue
Block a user