Skip to content

Commit fdd5422

Browse files
authored
Merge 367e38b into 72388fa
2 parents 72388fa + 367e38b commit fdd5422

File tree

34 files changed

+2041
-1165
lines changed

34 files changed

+2041
-1165
lines changed

assets/tests/add_system/added_systems_run_in_parallel.lua

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,32 @@ digraph {
3030
node_5 [label="bevy_mod_scripting_core::handler::script_error_logger"];
3131
node_6 [label="script_integration_test_harness::dummy_before_post_update_system"];
3232
node_7 [label="script_integration_test_harness::dummy_post_update_system"];
33-
node_8 [label="on_test_post_update"];
34-
node_9 [label="custom_system_a"];
35-
node_10 [label="custom_system_b"];
36-
node_11 [label="SystemSet AssetEvents"];
37-
node_12 [label="SystemSet GarbageCollection"];
38-
node_13 [label="SystemSet ScriptSystem(custom_system_a)"];
39-
node_14 [label="SystemSet ScriptSystem(custom_system_b)"];
40-
node_0 -> node_11 [color=red, label="child of", arrowhead=diamond];
41-
node_1 -> node_11 [color=red, label="child of", arrowhead=diamond];
42-
node_2 -> node_11 [color=red, label="child of", arrowhead=diamond];
43-
node_3 -> node_11 [color=red, label="child of", arrowhead=diamond];
44-
node_4 -> node_12 [color=red, label="child of", arrowhead=diamond];
45-
node_9 -> node_13 [color=red, label="child of", arrowhead=diamond];
46-
node_10 -> node_14 [color=red, label="child of", arrowhead=diamond];
33+
node_8 [label="bevy_mod_scripting_core::pipeline::start::filter_script_attachments<bevy_mod_scripting_lua::LuaScriptingPlugin>"];
34+
node_9 [label="bevy_mod_scripting_core::pipeline::start::filter_script_detachments<bevy_mod_scripting_lua::LuaScriptingPlugin>"];
35+
node_10 [label="bevy_mod_scripting_core::pipeline::start::filter_script_modifications<bevy_mod_scripting_lua::LuaScriptingPlugin>"];
36+
node_11 [label="bevy_mod_scripting_core::pipeline::automatic_pipeline_runner<bevy_mod_scripting_lua::LuaScriptingPlugin>"];
37+
node_12 [label="on_test_post_update"];
38+
node_13 [label="custom_system_a"];
39+
node_14 [label="custom_system_b"];
40+
node_15 [label="SystemSet AssetEvents"];
41+
node_16 [label="SystemSet GarbageCollection"];
42+
node_17 [label="SystemSet InitializePhase"];
43+
node_18 [label="SystemSet ScriptSystem(custom_system_a)"];
44+
node_19 [label="SystemSet ScriptSystem(custom_system_b)"];
45+
node_0 -> node_15 [color=red, label="child of", arrowhead=diamond];
46+
node_1 -> node_15 [color=red, label="child of", arrowhead=diamond];
47+
node_2 -> node_15 [color=red, label="child of", arrowhead=diamond];
48+
node_3 -> node_15 [color=red, label="child of", arrowhead=diamond];
49+
node_4 -> node_16 [color=red, label="child of", arrowhead=diamond];
50+
node_13 -> node_18 [color=red, label="child of", arrowhead=diamond];
51+
node_14 -> node_19 [color=red, label="child of", arrowhead=diamond];
4752
node_6 -> node_7 [color=blue, label="runs before", arrowhead=normal];
48-
node_8 -> node_9 [color=blue, label="runs before", arrowhead=normal];
49-
node_8 -> node_10 [color=blue, label="runs before", arrowhead=normal];
53+
node_8 -> node_17 [color=blue, label="runs before", arrowhead=normal];
54+
node_9 -> node_17 [color=blue, label="runs before", arrowhead=normal];
55+
node_10 -> node_17 [color=blue, label="runs before", arrowhead=normal];
56+
node_12 -> node_13 [color=blue, label="runs before", arrowhead=normal];
57+
node_12 -> node_14 [color=blue, label="runs before", arrowhead=normal];
58+
node_17 -> node_11 [color=blue, label="runs before", arrowhead=normal];
5059
}
5160
]]
5261
assert_str_eq(dot_graph, expected_dot_graph, "Expected the schedule graph to match the expected graph")

assets/tests/add_system/added_systems_run_in_parallel.rhai

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,32 @@ digraph {
2929
node_5 [label="bevy_mod_scripting_core::handler::script_error_logger"];
3030
node_6 [label="script_integration_test_harness::dummy_before_post_update_system"];
3131
node_7 [label="script_integration_test_harness::dummy_post_update_system"];
32-
node_8 [label="on_test_post_update"];
33-
node_9 [label="custom_system_a"];
34-
node_10 [label="custom_system_b"];
35-
node_11 [label="SystemSet AssetEvents"];
36-
node_12 [label="SystemSet GarbageCollection"];
37-
node_13 [label="SystemSet ScriptSystem(custom_system_a)"];
38-
node_14 [label="SystemSet ScriptSystem(custom_system_b)"];
39-
node_0 -> node_11 [color=red, label="child of", arrowhead=diamond];
40-
node_1 -> node_11 [color=red, label="child of", arrowhead=diamond];
41-
node_2 -> node_11 [color=red, label="child of", arrowhead=diamond];
42-
node_3 -> node_11 [color=red, label="child of", arrowhead=diamond];
43-
node_4 -> node_12 [color=red, label="child of", arrowhead=diamond];
44-
node_9 -> node_13 [color=red, label="child of", arrowhead=diamond];
45-
node_10 -> node_14 [color=red, label="child of", arrowhead=diamond];
32+
node_8 [label="bevy_mod_scripting_core::pipeline::start::filter_script_attachments<bevy_mod_scripting_rhai::RhaiScriptingPlugin>"];
33+
node_9 [label="bevy_mod_scripting_core::pipeline::start::filter_script_detachments<bevy_mod_scripting_rhai::RhaiScriptingPlugin>"];
34+
node_10 [label="bevy_mod_scripting_core::pipeline::start::filter_script_modifications<bevy_mod_scripting_rhai::RhaiScriptingPlugin>"];
35+
node_11 [label="bevy_mod_scripting_core::pipeline::automatic_pipeline_runner<bevy_mod_scripting_rhai::RhaiScriptingPlugin>"];
36+
node_12 [label="on_test_post_update"];
37+
node_13 [label="custom_system_a"];
38+
node_14 [label="custom_system_b"];
39+
node_15 [label="SystemSet AssetEvents"];
40+
node_16 [label="SystemSet GarbageCollection"];
41+
node_17 [label="SystemSet InitializePhase"];
42+
node_18 [label="SystemSet ScriptSystem(custom_system_a)"];
43+
node_19 [label="SystemSet ScriptSystem(custom_system_b)"];
44+
node_0 -> node_15 [color=red, label="child of", arrowhead=diamond];
45+
node_1 -> node_15 [color=red, label="child of", arrowhead=diamond];
46+
node_2 -> node_15 [color=red, label="child of", arrowhead=diamond];
47+
node_3 -> node_15 [color=red, label="child of", arrowhead=diamond];
48+
node_4 -> node_16 [color=red, label="child of", arrowhead=diamond];
49+
node_13 -> node_18 [color=red, label="child of", arrowhead=diamond];
50+
node_14 -> node_19 [color=red, label="child of", arrowhead=diamond];
4651
node_6 -> node_7 [color=blue, label="runs before", arrowhead=normal];
47-
node_8 -> node_9 [color=blue, label="runs before", arrowhead=normal];
48-
node_8 -> node_10 [color=blue, label="runs before", arrowhead=normal];
52+
node_8 -> node_17 [color=blue, label="runs before", arrowhead=normal];
53+
node_9 -> node_17 [color=blue, label="runs before", arrowhead=normal];
54+
node_10 -> node_17 [color=blue, label="runs before", arrowhead=normal];
55+
node_12 -> node_13 [color=blue, label="runs before", arrowhead=normal];
56+
node_12 -> node_14 [color=blue, label="runs before", arrowhead=normal];
57+
node_17 -> node_11 [color=blue, label="runs before", arrowhead=normal];
4958
}`;
5059

5160
assert_str_eq.call(dot_graph, expected_dot_graph, "Expected the schedule graph to match the expected graph");

assets/tests/lifecycle/default/entity_script/callback/scenario.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SetCurrentLanguage language="@this_script_language"
2-
InstallPlugin
2+
InstallPlugin miliseconds_budget=999999
33
SetupHandler OnTest=null, Update=null
44
SetupHandler OnTestPostUpdate=null, PostUpdate=null
55
SetupHandler Last=null, OnTestLast=null

assets/tests/lifecycle/default/static_script/callback/scenario.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SetCurrentLanguage language="@this_script_language"
2-
InstallPlugin
2+
InstallPlugin miliseconds_budget=999999
33
SetupHandler OnTest=null, Update=null
44
SetupHandler OnTestPostUpdate=null, PostUpdate=null
55
SetupHandler Last=null, OnTestLast=null

assets/tests/lifecycle/shared/entity_script/scenario.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ AssertCallbackSuccess attachment="EntityScript", label="OnScriptLoaded", script=
1919
AssertCallbackSuccess attachment="EntityScript", label="OnScriptReloaded", script="script_a", entity="test_entity_a", expect_string_value="reloaded with: unloaded!"
2020
AssertNoCallbackResponsesEmitted
2121

22-
// load licecycle_b.lua, which prefixes all outputs with "B"
22+
// load licecycle_b.lua, which prefixes all outputs with "B", the unload callback is called using the old script's state
2323
LoadScriptAs as_name="script_b", path="lifecycle_b.lua"
2424
WaitForScriptLoaded name="script_b"
2525
SpawnEntityWithScript name="test_entity_b", script="script_b"
2626
RunUpdateOnce
27+
AssertCallbackSuccess attachment="EntityScript", label="OnScriptUnloaded", script="script_b", entity="test_entity_b", expect_string_value="unloaded!"
2728
AssertCallbackSuccess attachment="EntityScript", label="OnScriptLoaded", script="script_b", entity="test_entity_b", expect_string_value="B: loaded!"
29+
AssertCallbackSuccess attachment="EntityScript", label="OnScriptReloaded", script="script_b", entity="test_entity_b", expect_string_value="B: reloaded with: unloaded!"
2830
AssertNoCallbackResponsesEmitted
2931

3032
// reload script_b, with the same content

assets/tests/lifecycle/shared/static_script/scenario.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ LoadScriptAs as_name="script_b", path="lifecycle_b.lua"
2424
WaitForScriptLoaded name="script_b"
2525
AttachStaticScript script="script_b"
2626
RunUpdateOnce
27+
AssertCallbackSuccess attachment="StaticScript", label="OnScriptUnloaded", script="script_b", expect_string_value="unloaded!"
2728
AssertCallbackSuccess attachment="StaticScript", label="OnScriptLoaded", script="script_b", expect_string_value="B: loaded!"
29+
AssertCallbackSuccess attachment="StaticScript", label="OnScriptReloaded", script="script_b", expect_string_value="B: reloaded with: unloaded!"
2830
AssertNoCallbackResponsesEmitted
2931

3032
// reload script_b, with the same content

assets/tests/scenario.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SetCurrentLanguage language="@this_script_language"
2-
InstallPlugin
2+
InstallPlugin miliseconds_budget=999999
33
SetupHandler OnTest=null, Update=null
44
SetupHandler OnTestPostUpdate=null, PostUpdate=null
55
SetupHandler Last=null, OnTestLast=null

crates/bevy_mod_scripting_asset/src/script_asset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use bevy_reflect::Reflect;
66
use crate::Language;
77

88
/// Represents a script loaded into memory as an asset
9-
#[derive(Asset, Clone, Reflect)]
9+
#[derive(Asset, Clone, Reflect, Default)]
1010
#[reflect(opaque)]
1111
pub struct ScriptAsset {
1212
/// The body of the script

crates/bevy_mod_scripting_core/src/asset.rs

Lines changed: 0 additions & 202 deletions
This file was deleted.

0 commit comments

Comments
 (0)