Class MyPlayerScript
Example script showing how to consume a C# class generated from an .inputactions asset via the "Generate C# Class" option.
Implements
Inherited Members
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.FindAnyObjectByType<T>()
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Namespace: DocCodeSamples.Tests
Assembly: Unity.InputSystem.DocCodeSamples.dll
Syntax
public class MyPlayerScript : MonoBehaviour, MyPlayerControls.IGameplayActions
Methods
OnDisable()
Called by Unity when the component is disabled.
Declaration
public void OnDisable()
OnEnable()
Called by Unity when the component is enabled.
Declaration
public void OnEnable()
OnMove(CallbackContext)
Called when the "move" action is triggered.
Declaration
public void OnMove(InputAction.CallbackContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| InputAction.CallbackContext | context | Context for the triggered action. |
OnUse(CallbackContext)
Called when the "use" action is triggered.
Declaration
public void OnUse(InputAction.CallbackContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| InputAction.CallbackContext | context | Context for the triggered action. |