-
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.
- Loading branch information
Showing
172 changed files
with
4,359 additions
and
3,091 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ system: jira | |
server: jira.unity3d.com | ||
project: ISXB | ||
issuetype: Bug | ||
|
||
package: Input System |
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 |
---|---|---|
|
@@ -12,9 +12,10 @@ | |
commands: | ||
- {{ utr_install_win }} | ||
- {{ upm_ci_install }} | ||
# Get latest version of doctools package. Automatically makes the documentation tests in APIVerification go live. | ||
# Get version 2.3.0-preview of doctools package (it currently fails for 3.0.0-preview). | ||
# Automatically makes the documentation tests in APIVerification go live. | ||
- '%GSUDO% choco install netfx-4.7.1-devpack -y --ignore-detected-reboot --ignore-package-codes' | ||
- git clone [email protected]:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools | ||
- git clone --branch "2.3.0-preview" [email protected]:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools | ||
# We keep the samples in Assets/ as they otherwise won't get imported and you can't | ||
# really work with them. Move them into the package for when we run upm-ci here. | ||
- move /Y .\Assets\Samples .\Packages\com.unity.inputsystem | ||
|
@@ -47,8 +48,9 @@ | |
commands: | ||
- {{ utr_install_nix }} | ||
- {{ upm_ci_install }} | ||
# Get latest version of doctools package. Automatically makes the documentation tests in APIVerification go live. | ||
- git clone [email protected]:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools | ||
# Get version 2.3.0-preview of doctools package (it currently fails for 3.0.0-preview). | ||
# Automatically makes the documentation tests in APIVerification go live. | ||
- git clone --branch "2.3.0-preview" [email protected]:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools | ||
# We keep the samples in Assets/ as they otherwise won't get imported and you can't | ||
# really work with them. Move them into the package for when we run upm-ci here. | ||
- mv ./Assets/Samples ./Packages/com.unity.inputsystem | ||
|
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ActionsTest/ProjectWideActionsTest.asmdef → ...jectWideActions/ProjectWideActions.asmdef
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
File renamed without changes.
48 changes: 48 additions & 0 deletions
48
Assets/Samples/ProjectWideActions/ProjectWideActionsExample.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,48 @@ | ||
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS | ||
|
||
namespace UnityEngine.InputSystem.Samples.ProjectWideActions | ||
{ | ||
public class ProjectWideActionsExample : MonoBehaviour | ||
{ | ||
[SerializeField] public GameObject cube; | ||
|
||
InputAction move; | ||
InputAction look; | ||
InputAction attack; | ||
InputAction jump; | ||
InputAction interact; | ||
InputAction next; | ||
InputAction previous; | ||
InputAction sprint; | ||
InputAction crouch; | ||
|
||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
// Project-Wide Actions | ||
move = InputSystem.actions.FindAction("Player/Move"); | ||
look = InputSystem.actions.FindAction("Player/Look"); | ||
attack = InputSystem.actions.FindAction("Player/Attack"); | ||
jump = InputSystem.actions.FindAction("Player/Jump"); | ||
interact = InputSystem.actions.FindAction("Player/Interact"); | ||
next = InputSystem.actions.FindAction("Player/Next"); | ||
previous = InputSystem.actions.FindAction("Player/Previous"); | ||
sprint = InputSystem.actions.FindAction("Player/Sprint"); | ||
crouch = InputSystem.actions.FindAction("Player/Crouch"); | ||
|
||
// Handle input by responding to callbacks | ||
attack.performed += ctx => cube.GetComponent<Renderer>().material.color = Color.red; | ||
attack.canceled += ctx => cube.GetComponent<Renderer>().material.color = Color.green; | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
// Handle input by polling each frame | ||
var moveVal = move.ReadValue<Vector2>() * 10.0f * Time.deltaTime; | ||
cube.transform.Translate(new Vector3(moveVal.x, moveVal.y, 0)); | ||
} | ||
} // class ProjectWideActionsExample | ||
} // namespace UnityEngine.InputSystem.Samples.ProjectWideActions | ||
|
||
#endif |
File renamed without changes.
File renamed without changes.
File renamed without changes.
66 changes: 0 additions & 66 deletions
66
Assets/Samples/ProjectWideActionsTest/ProjectWideActionsTest.cs
This file was deleted.
Oops, something went wrong.
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
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,82 @@ | ||
using System.Collections; | ||
using NUnit.Framework; | ||
using UnityEngine; | ||
using UnityEditor; | ||
using UnityEngine.TestTools; | ||
using UnityEditor.PackageManager; | ||
using UnityEditor.PackageManager.Requests; | ||
|
||
// Disable irrelevant warning about there not being underscores in method names. | ||
#pragma warning disable CA1707 | ||
|
||
public class XRIPackageTests | ||
{ | ||
static AddRequest XRAddRequest; | ||
static RemoveRequest XRRemoveRequest; | ||
|
||
/// <summary> | ||
/// TearDown removes the added XRI package again. | ||
/// If you are adding a 2nd test that needs the XRI package adjust this. | ||
/// </summary> | ||
/// <returns></returns> | ||
[UnityTearDown] | ||
public IEnumerator TearDown() | ||
{ | ||
XRRemoveRequest = Client.Remove("com.unity.xr.interaction.toolkit"); | ||
EditorApplication.update += RemoveProgress; | ||
while (!XRRemoveRequest.IsCompleted) | ||
{ | ||
yield return null; | ||
} | ||
} | ||
|
||
[UnityTest] | ||
[Category("Integration")] | ||
public IEnumerator AdddingLatestXRIPackageThrowsNoErrors() | ||
{ | ||
Application.logMessageReceived += HandleLog; | ||
|
||
XRAddRequest = Client.Add("com.unity.xr.interaction.toolkit"); | ||
EditorApplication.update += AddProgress; | ||
|
||
while (!XRAddRequest.IsCompleted) | ||
{ | ||
yield return null; | ||
} | ||
|
||
AssetDatabase.Refresh(); | ||
|
||
yield return new WaitForDomainReload(); | ||
} | ||
|
||
static void AddProgress() | ||
{ | ||
if (XRAddRequest.IsCompleted) | ||
{ | ||
if (XRAddRequest.Status == StatusCode.Success) | ||
Debug.Log("Installed: " + XRAddRequest.Result.packageId); | ||
else if (XRAddRequest.Status >= StatusCode.Failure) | ||
Debug.Log(XRAddRequest.Error.message); | ||
|
||
EditorApplication.update -= AddProgress; | ||
} | ||
} | ||
|
||
static void RemoveProgress() | ||
{ | ||
if (XRRemoveRequest.IsCompleted) | ||
{ | ||
if (XRRemoveRequest.Status == StatusCode.Success) | ||
Debug.Log("Removed: XRI package"); | ||
else if (XRRemoveRequest.Status >= StatusCode.Failure) | ||
Debug.Log(XRRemoveRequest.Error.message); | ||
|
||
EditorApplication.update -= RemoveProgress; | ||
} | ||
} | ||
|
||
void HandleLog(string logString, string stackTrace, LogType type) | ||
{ | ||
Assert.That(type, Is.EqualTo(LogType.Log)); | ||
} | ||
} |
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.