Skip to main content

Class ReloadLevelAction

A component that listens for a specified input action and restarts the current level when the action is performed. Attach this to a GameObject and assign an InputActionReference.

[DisallowMultipleComponent]
public class ReloadLevelAction : MonoBehaviour

Inheritance​

Methods​

OnAction()​

Invoked when the reload action is triggered. Restarts the current level if a valid GameMode is active and the component is enabled.

public void OnAction()

OnAction(CallbackContext)​

Invoked when the reload input action is performed. Restarts the current level if a valid GameMode is active and the input context reports the action as performed.

public void OnAction(InputAction.CallbackContext context)

Parameters​

NameTypeDescription
contextInputAction.CallbackContextCallback context from the performed input action.
  • Methods
    • OnAction()
    • OnAction(CallbackContext)