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 () {
2020 }
2121
2222 protected override void OnExit ( ) {
23- initLogic ? . Invoke ( ) ;
23+ exitLogic ? . Invoke ( ) ;
2424 }
2525
2626 protected override void OnInit ( ) {
27- exitLogic ? . Invoke ( ) ;
27+ initLogic ? . Invoke ( ) ;
2828 }
2929 }
30- }
30+ }
Original file line number Diff line number Diff line change @@ -44,6 +44,19 @@ public void It_should_execute_a_init_hook () {
4444 Assert . AreEqual ( 1 , test ) ;
4545 }
4646
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+
4760 [ Test ]
4861 public void It_should_execute_a_exit_hook ( ) {
4962 var test = 0 ;
@@ -57,4 +70,4 @@ public void It_should_execute_a_exit_hook () {
5770 }
5871 }
5972 }
60- }
73+ }
You can’t perform that action at this time.
0 commit comments