File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed
Basic/DistributedAuthoritySocialHub/Assets/Scripts/UI Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,14 @@ void OnEnable()
4747 GameplayEventHandler . OnPickupStateChanged += OnPickupStateChanged ;
4848 }
4949
50- private void OnPickupStateChanged ( PickupState state , Transform pickupTransform )
50+ void OnPickupStateChanged ( PickupState state , Transform pickupTransform )
5151 {
5252 if ( state == PickupState . Carry )
5353 {
5454 ShowCarry ( pickupTransform ) ;
55+ return ;
5556 }
56- else
57- {
58- HideCarry ( ) ;
59- }
57+ HideCarry ( ) ;
6058 }
6159
6260 void ShowCarry ( Transform t )
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ void OnEnable()
7373 GameplayEventHandler . OnPickupStateChanged += OnPickupStateChanged ;
7474 }
7575
76- private void OnPickupStateChanged ( PickupState state , Transform pickupTransform )
76+ void OnPickupStateChanged ( PickupState state , Transform pickupTransform )
7777 {
7878 switch ( state )
7979 {
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ static class UIElementNames
1717 internal const string ButtonJump = "ButtonJump" ;
1818 internal const string ButtonSprint = "ButtonSprint" ;
1919 internal const string ButtonInteract = "ButtonInteract" ;
20- //public const string ButtonToggleNetworkStats = "ButtonToggleNetworkStats";
2120 internal const string PlayerContainer = "PlayerContainer" ;
2221 }
2322
@@ -84,7 +83,7 @@ async void OnEnable()
8483 GameplayEventHandler . OnPickupStateChanged += OnPickupStateChanged ;
8584 }
8685
87- private void OnPickupStateChanged ( PickupState state , Transform _ )
86+ void OnPickupStateChanged ( PickupState state , Transform _ )
8887 {
8988 m_ButtonInteract . enabledSelf = state != PickupState . Inactive ;
9089
@@ -106,7 +105,7 @@ void OnDisable()
106105 m_JoystickLeft = null ;
107106 m_JoystickRight ? . Dispose ( ) ;
108107 m_JoystickRight = null ;
109-
108+
110109 GameplayEventHandler . OnPickupStateChanged -= OnPickupStateChanged ;
111110 }
112111
You can’t perform that action at this time.
0 commit comments