-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into ci/add-coverage
- Loading branch information
Showing
19 changed files
with
1,853 additions
and
389 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...om.unity.inputsystem/DocCodeSamples.Tests/InputSystemUIInputModuleAssignActionsExample.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#if UNITY_INPUT_SYSTEM_ENABLE_UI | ||
|
||
using UnityEngine; | ||
using UnityEngine.InputSystem.UI; | ||
|
||
namespace DocCodeSamples.Tests | ||
{ | ||
internal class InputSystemUIInputModuleAssignActionsExample : MonoBehaviour | ||
{ | ||
// Reference to the InputSystemUIInputModule component, needs to be provided in the Inspector | ||
public InputSystemUIInputModule uiModule; | ||
|
||
void Start() | ||
{ | ||
// Assign default actions | ||
AssignActions(); | ||
} | ||
|
||
void AssignActions() | ||
{ | ||
if (uiModule != null) | ||
uiModule.AssignDefaultActions(); | ||
else | ||
Debug.LogError("InputSystemUIInputModule not found."); | ||
} | ||
|
||
void UnassignActions() | ||
{ | ||
if (uiModule != null) | ||
uiModule.UnassignActions(); | ||
else | ||
Debug.LogError("InputSystemUIInputModule not found."); | ||
} | ||
|
||
void OnDestroy() | ||
{ | ||
// Unassign actions when the object is destroyed | ||
UnassignActions(); | ||
} | ||
} | ||
} | ||
#endif |
3 changes: 3 additions & 0 deletions
3
...ity.inputsystem/DocCodeSamples.Tests/InputSystemUIInputModuleAssignActionsExample.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.