@@ -13,8 +13,6 @@ public class ProjectWideActionsExample : MonoBehaviour
1313 InputAction previous ;
1414 InputAction sprint ;
1515 InputAction crouch ;
16- InputAction b ;
17- InputAction shiftB ;
1816
1917 // Start is called before the first frame update
2018 void Start ( )
@@ -31,8 +29,6 @@ void Start()
3129 previous = InputSystem . actions . FindAction ( "Player/Previous" ) ;
3230 sprint = InputSystem . actions . FindAction ( "Player/Sprint" ) ;
3331 crouch = InputSystem . actions . FindAction ( "Player/Crouch" ) ;
34- b = InputSystem . actions . FindAction ( "Player/B" ) ;
35- shiftB = InputSystem . actions . FindAction ( "Player/Shift B" ) ;
3632 }
3733 else
3834 {
@@ -45,18 +41,6 @@ void Start()
4541 attack . performed += OnAttack ;
4642 attack . canceled += OnCancel ;
4743 }
48-
49- if ( b != null )
50- {
51- b . performed += OnB ;
52- b . canceled += OnCancel ;
53- }
54-
55- if ( shiftB != null )
56- {
57- shiftB . performed += OnShiftB ;
58- shiftB . canceled += OnCancel ;
59- }
6044 }
6145
6246 private void OnAttack ( InputAction . CallbackContext ctx )
@@ -69,35 +53,13 @@ private void OnCancel(InputAction.CallbackContext ctx)
6953 cube . GetComponent < Renderer > ( ) . material . color = Color . green ;
7054 }
7155
72- private void OnB ( InputAction . CallbackContext ctx )
73- {
74- Debug . Log ( "B WAS PRESSED" ) ;
75- cube . GetComponent < Renderer > ( ) . material . color = Color . yellow ;
76- }
77-
78- private void OnShiftB ( InputAction . CallbackContext ctx )
79- {
80- Debug . Log ( "SHIFT + B WAS PRESSED" ) ;
81- cube . GetComponent < Renderer > ( ) . material . color = Color . blue ;
82- }
83-
8456 void OnDestroy ( )
8557 {
8658 if ( attack != null )
8759 {
8860 attack . performed -= OnAttack ;
8961 attack . canceled -= OnCancel ;
9062 }
91- if ( b != null )
92- {
93- b . performed -= OnB ;
94- b . canceled -= OnCancel ;
95- }
96- if ( shiftB != null )
97- {
98- shiftB . performed -= OnShiftB ;
99- shiftB . canceled -= OnCancel ;
100- }
10163 }
10264
10365 // Update is called once per frame
@@ -109,16 +71,6 @@ void Update()
10971 var moveVal = move . ReadValue < Vector2 > ( ) * 10.0f * Time . deltaTime ;
11072 cube . transform . Translate ( new Vector3 ( moveVal . x , moveVal . y , 0 ) ) ;
11173 }
112-
113- if ( shiftB . IsPressed ( ) )
114- {
115- Debug . Log ( "SHIFT + B WAS PRESSED" ) ;
116- }
117-
118- if ( b . IsPressed ( ) )
119- {
120- Debug . Log ( "B WAS PRESSED" ) ;
121- }
12274 }
12375 } // class ProjectWideActionsExample
12476} // namespace UnityEngine.InputSystem.Samples.ProjectWideActions
0 commit comments