If you want a quick&dirty drop-in replacement:
if( Mouse.current.leftButton.wasPressedThisFrame ) {
However, that's not how the new input system is supposed to be used. The old input system was based on the philosophy that you poll the state of the input devices during Update. The new input system is based on events. You don't ask the system what's the input state,state; the system tells you that an input event occurred by calling a callback method. The new input system also works with an Input Actions asset which allowsBut doing it like that requires that you to define semantic inputs (like "shoot") and then assign multiple controls to them (like left mouse button, Gamepad button X, keyboard keys Space and x and pressingcompletely rethink the touchscreen)way you handle input in your game.
What you usually have in a project using the new input system is:
- An Input Actions asset which allows you to define semantic input actions (like "shoot") and then assign multiple controls to them (like left mouse button, Gamepad button X, keyboard keys Space and x and pressing the touchscreen).
- A bunch of handler-methods on various scripts which are supposed to be called when one of those semantic input actions happens
- A PlayerInput component which links semantic actions to the handler-methods.
But explaining the whole thing from start to finish would be yet another Unity new input system tutorial. Others have already created enough of those which are easy to find with your preferred search engine. Or you could read the manual which also offers a pretty good introduction into how to use the system efficiently.