@@ -13,8 +13,13 @@ use bevy_script_api::{
13
13
remote = "bevy::ecs::entity::Entity" ,
14
14
functions[ r#"
15
15
16
- #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
17
- fn clone(&self) -> bevy::ecs::entity::Entity;
16
+ #[lua(
17
+ as_trait = "std::cmp::PartialEq",
18
+ kind = "MetaFunction",
19
+ composite = "eq",
20
+ metamethod = "Eq",
21
+ )]
22
+ fn eq(&self, #[proxy] other: &entity::Entity) -> bool;
18
23
19
24
"# ,
20
25
r#"
@@ -73,13 +78,8 @@ use bevy_script_api::{
73
78
"# ,
74
79
r#"
75
80
76
- #[lua(
77
- as_trait = "std::cmp::PartialEq",
78
- kind = "MetaFunction",
79
- composite = "eq",
80
- metamethod = "Eq",
81
- )]
82
- fn eq(&self, #[proxy] other: &entity::Entity) -> bool;
81
+ #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
82
+ fn clone(&self) -> bevy::ecs::entity::Entity;
83
83
84
84
"# ,
85
85
r#"
@@ -143,17 +143,6 @@ struct OnReplace {}
143
143
derive( clone) ,
144
144
remote = "bevy::ecs::component::ComponentId" ,
145
145
functions[ r#"
146
-
147
- #[lua(
148
- as_trait = "std::cmp::PartialEq",
149
- kind = "MetaFunction",
150
- composite = "eq",
151
- metamethod = "Eq",
152
- )]
153
- fn eq(&self, #[proxy] other: &component::ComponentId) -> bool;
154
-
155
- "# ,
156
- r#"
157
146
/// Creates a new [`ComponentId`].
158
147
/// The `index` is a unique value associated with each type of component in a given world.
159
148
/// Usually, this value is taken from a counter incremented for each type of component registered with the world.
@@ -174,6 +163,17 @@ struct OnReplace {}
174
163
#[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
175
164
fn clone(&self) -> bevy::ecs::component::ComponentId;
176
165
166
+ "# ,
167
+ r#"
168
+
169
+ #[lua(
170
+ as_trait = "std::cmp::PartialEq",
171
+ kind = "MetaFunction",
172
+ composite = "eq",
173
+ metamethod = "Eq",
174
+ )]
175
+ fn eq(&self, #[proxy] other: &component::ComponentId) -> bool;
176
+
177
177
"# ,
178
178
r#"
179
179
@@ -195,8 +195,8 @@ struct ComponentId();
195
195
remote = "bevy::ecs::component::Tick" ,
196
196
functions[ r#"
197
197
198
- #[lua(as_trait = "std::cmp::Eq ", kind = "Method")]
199
- fn assert_receiver_is_total_eq (&self) -> () ;
198
+ #[lua(as_trait = "std::clone::Clone ", kind = "Method", output(proxy) )]
199
+ fn clone (&self) -> bevy::ecs::component::Tick ;
200
200
201
201
"# ,
202
202
r#"
@@ -212,8 +212,8 @@ struct ComponentId();
212
212
"# ,
213
213
r#"
214
214
215
- #[lua(as_trait = "std::clone::Clone ", kind = "Method", output(proxy) )]
216
- fn clone (&self) -> bevy::ecs::component::Tick ;
215
+ #[lua(as_trait = "std::cmp::Eq ", kind = "Method")]
216
+ fn assert_receiver_is_total_eq (&self) -> () ;
217
217
218
218
"# ,
219
219
r#"
@@ -264,12 +264,6 @@ struct Tick {}
264
264
derive( clone) ,
265
265
remote = "bevy::ecs::component::ComponentTicks" ,
266
266
functions[ r#"
267
-
268
- #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
269
- fn clone(&self) -> bevy::ecs::component::ComponentTicks;
270
-
271
- "# ,
272
- r#"
273
267
/// Returns `true` if the component or resource was added after the system last ran
274
268
/// (or the system is running for the first time).
275
269
@@ -298,17 +292,13 @@ struct Tick {}
298
292
299
293
"# ,
300
294
r#"
301
- /// Returns the tick recording the time this component or resource was most recently changed.
295
+ /// Creates a new instance with the same change tick for `added` and ` changed` .
302
296
303
- #[lua(kind = "Method", output(proxy))]
304
- fn last_changed_tick(&self) -> bevy::ecs::component::Tick;
305
-
306
- "# ,
307
- r#"
308
- /// Returns the tick recording the time this component or resource was added.
309
-
310
- #[lua(kind = "Method", output(proxy))]
311
- fn added_tick(&self) -> bevy::ecs::component::Tick;
297
+ #[lua(kind = "Function", output(proxy))]
298
+ fn new(
299
+ #[proxy]
300
+ change_tick: bevy::ecs::component::Tick,
301
+ ) -> bevy::ecs::component::ComponentTicks;
312
302
313
303
"# ,
314
304
r#"
@@ -327,6 +317,12 @@ struct Tick {}
327
317
#[lua(kind = "MutatingMethod")]
328
318
fn set_changed(&mut self, #[proxy] change_tick: bevy::ecs::component::Tick) -> ();
329
319
320
+ "# ,
321
+ r#"
322
+
323
+ #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
324
+ fn clone(&self) -> bevy::ecs::component::ComponentTicks;
325
+
330
326
"# ,
331
327
r#"
332
328
#[lua(kind="MetaMethod", metamethod="ToString")]
@@ -335,19 +331,18 @@ fn index(&self) -> String {
335
331
}
336
332
"# ]
337
333
) ]
338
- struct ComponentTicks { }
334
+ struct ComponentTicks {
335
+ #[ lua( output( proxy) ) ]
336
+ added : bevy:: ecs:: component:: Tick ,
337
+ #[ lua( output( proxy) ) ]
338
+ changed : bevy:: ecs:: component:: Tick ,
339
+ }
339
340
#[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
340
341
#[ proxy(
341
342
derive( clone) ,
342
343
remote = "bevy::ecs::identifier::Identifier" ,
343
344
functions[ r#"
344
345
345
- #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
346
- fn clone(&self) -> bevy::ecs::identifier::Identifier;
347
-
348
- "# ,
349
- r#"
350
-
351
346
#[lua(
352
347
as_trait = "std::cmp::PartialEq",
353
348
kind = "MetaFunction",
@@ -387,6 +382,12 @@ struct ComponentTicks {}
387
382
#[lua(kind = "Function", output(proxy))]
388
383
fn from_bits(value: u64) -> bevy::ecs::identifier::Identifier;
389
384
385
+ "# ,
386
+ r#"
387
+
388
+ #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
389
+ fn clone(&self) -> bevy::ecs::identifier::Identifier;
390
+
390
391
"# ,
391
392
r#"
392
393
#[lua(kind="MetaMethod", metamethod="ToString")]
@@ -451,6 +452,13 @@ impl bevy_mod_scripting_lua::tealr::mlu::ExportInstances for Globals {
451
452
"Tick" ,
452
453
bevy_mod_scripting_lua:: tealr:: mlu:: UserDataProxy :: < LuaTick > :: new,
453
454
) ?;
455
+ instances
456
+ . add_instance (
457
+ "ComponentTicks" ,
458
+ bevy_mod_scripting_lua:: tealr:: mlu:: UserDataProxy :: <
459
+ LuaComponentTicks ,
460
+ > :: new,
461
+ ) ?;
454
462
instances
455
463
. add_instance (
456
464
"Identifier" ,
@@ -500,6 +508,11 @@ impl bevy_mod_scripting_core::hosts::APIProvider for BevyEcsAPIProvider {
500
508
bevy_mod_scripting_lua:: tealr:: mlu:: UserDataProxy < LuaTick > ,
501
509
> ( )
502
510
. process_type :: < LuaComponentTicks > ( )
511
+ . process_type :: <
512
+ bevy_mod_scripting_lua:: tealr:: mlu:: UserDataProxy <
513
+ LuaComponentTicks ,
514
+ > ,
515
+ > ( )
503
516
. process_type :: < LuaIdentifier > ( )
504
517
. process_type :: <
505
518
bevy_mod_scripting_lua:: tealr:: mlu:: UserDataProxy <
0 commit comments