File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ struct Paddle {
1212 motion : f32 ,
1313 you_hidden : bool ,
1414 #[ export]
15- you_label : Option < Gd < Label > > ,
15+ you_label : OnEditor < Gd < Label > > ,
1616
1717 base : Base < Area2D > ,
1818}
@@ -41,7 +41,7 @@ impl IArea2D for Paddle {
4141 self . motion = input. get_axis ( "move_up" , "move_down" ) ;
4242
4343 if !self . you_hidden && self . motion != 0.0 {
44- self . you_label . as_mut ( ) . unwrap ( ) . hide ( ) ;
44+ self . you_label . hide ( ) ;
4545 }
4646
4747 self . motion *= MOTION_SPEED ;
@@ -51,7 +51,7 @@ impl IArea2D for Paddle {
5151 let args = vslice ! [ self . base( ) . get_position( ) , self . motion] ;
5252 self . base_mut ( ) . rpc ( "set_pos_and_motion" , args) ;
5353 } else if !self . you_hidden {
54- self . you_label . as_mut ( ) . unwrap ( ) . hide ( ) ;
54+ self . you_label . hide ( ) ;
5555 }
5656
5757 let translation = Vector2 :: new ( 0.0 , self . motion * delta as f32 ) ;
You can’t perform that action at this time.
0 commit comments