File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Tests/Editor/Tasks/Actions Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,11 @@ protected override void OnStart () {
20
20
}
21
21
22
22
protected override void OnExit ( ) {
23
- initLogic ? . Invoke ( ) ;
23
+ exitLogic ? . Invoke ( ) ;
24
24
}
25
25
26
26
protected override void OnInit ( ) {
27
- exitLogic ? . Invoke ( ) ;
27
+ initLogic ? . Invoke ( ) ;
28
28
}
29
29
}
30
- }
30
+ }
Original file line number Diff line number Diff line change @@ -44,6 +44,19 @@ public void It_should_execute_a_init_hook () {
44
44
Assert . AreEqual ( 1 , test ) ;
45
45
}
46
46
47
+ [ Test ]
48
+ public void It_should_execute_init_hook_on_continue ( ) {
49
+ var test = 0 ;
50
+ var task = new ActionGeneric {
51
+ initLogic = ( ) => { test ++ ; } ,
52
+ updateLogic = ( ) => TaskStatus . Continue ,
53
+ } ;
54
+
55
+ task . Update ( ) ;
56
+
57
+ Assert . AreEqual ( 1 , test ) ;
58
+ }
59
+
47
60
[ Test ]
48
61
public void It_should_execute_a_exit_hook ( ) {
49
62
var test = 0 ;
@@ -57,4 +70,4 @@ public void It_should_execute_a_exit_hook () {
57
70
}
58
71
}
59
72
}
60
- }
73
+ }
You can’t perform that action at this time.
0 commit comments