Skip to content

Commit f1497f4

Browse files
committed
Merge branch 'develop' into stable
2 parents a830638 + 0fd21bc commit f1497f4

File tree

172 files changed

+4359
-3091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+4359
-3091
lines changed

.buginfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ system: jira
22
server: jira.unity3d.com
33
project: ISXB
44
issuetype: Bug
5-
5+
package: Input System

.yamato/upm-ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
commands:
1313
- {{ utr_install_win }}
1414
- {{ upm_ci_install }}
15-
# Get latest version of doctools package. Automatically makes the documentation tests in APIVerification go live.
15+
# Get version 2.3.0-preview of doctools package (it currently fails for 3.0.0-preview).
16+
# Automatically makes the documentation tests in APIVerification go live.
1617
- '%GSUDO% choco install netfx-4.7.1-devpack -y --ignore-detected-reboot --ignore-package-codes'
17-
- git clone git@github.cds.internal.unity3d.com:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools
18+
- git clone --branch "2.3.0-preview" git@github.cds.internal.unity3d.com:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools
1819
# We keep the samples in Assets/ as they otherwise won't get imported and you can't
1920
# really work with them. Move them into the package for when we run upm-ci here.
2021
- move /Y .\Assets\Samples .\Packages\com.unity.inputsystem
@@ -47,8 +48,9 @@
4748
commands:
4849
- {{ utr_install_nix }}
4950
- {{ upm_ci_install }}
50-
# Get latest version of doctools package. Automatically makes the documentation tests in APIVerification go live.
51-
- git clone git@github.cds.internal.unity3d.com:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools
51+
# Get version 2.3.0-preview of doctools package (it currently fails for 3.0.0-preview).
52+
# Automatically makes the documentation tests in APIVerification go live.
53+
- git clone --branch "2.3.0-preview" git@github.cds.internal.unity3d.com:unity/com.unity.package-manager-doctools.git Packages/com.unity.package-manager-doctools
5254
# We keep the samples in Assets/ as they otherwise won't get imported and you can't
5355
# really work with them. Move them into the package for when we run upm-ci here.
5456
- mv ./Assets/Samples ./Packages/com.unity.inputsystem

Assets/Samples/InGameHints/InGameHintsActions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using System.Collections.Generic;
1515
using UnityEngine.InputSystem;
1616
using UnityEngine.InputSystem.Utilities;
17+
using UnityEngine;
1718

1819
namespace UnityEngine.InputSystem.Samples.InGameHints
1920
{
@@ -272,6 +273,11 @@ public @InGameHintsActions()
272273
m_Gameplay_Throw = m_Gameplay.FindAction("Throw", throwIfNotFound: true);
273274
}
274275

276+
~@InGameHintsActions()
277+
{
278+
Debug.Assert(!m_Gameplay.enabled, "This will cause a leak and performance issues, InGameHintsActions.Gameplay.Disable() has not been called.");
279+
}
280+
275281
public void Dispose()
276282
{
277283
UnityEngine.Object.Destroy(asset);

Assets/Samples/ProjectWideActionsTest/ProjectWideActionsTest.asmdef renamed to Assets/Samples/ProjectWideActions/ProjectWideActions.asmdef

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "ProjectWideActionsTest",
2+
"name": "ProjectWideActions",
33
"rootNamespace": "",
44
"references": [
55
"GUID:75469ad4d38634e559750d17036d5f7c"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
2+
3+
namespace UnityEngine.InputSystem.Samples.ProjectWideActions
4+
{
5+
public class ProjectWideActionsExample : MonoBehaviour
6+
{
7+
[SerializeField] public GameObject cube;
8+
9+
InputAction move;
10+
InputAction look;
11+
InputAction attack;
12+
InputAction jump;
13+
InputAction interact;
14+
InputAction next;
15+
InputAction previous;
16+
InputAction sprint;
17+
InputAction crouch;
18+
19+
// Start is called before the first frame update
20+
void Start()
21+
{
22+
// Project-Wide Actions
23+
move = InputSystem.actions.FindAction("Player/Move");
24+
look = InputSystem.actions.FindAction("Player/Look");
25+
attack = InputSystem.actions.FindAction("Player/Attack");
26+
jump = InputSystem.actions.FindAction("Player/Jump");
27+
interact = InputSystem.actions.FindAction("Player/Interact");
28+
next = InputSystem.actions.FindAction("Player/Next");
29+
previous = InputSystem.actions.FindAction("Player/Previous");
30+
sprint = InputSystem.actions.FindAction("Player/Sprint");
31+
crouch = InputSystem.actions.FindAction("Player/Crouch");
32+
33+
// Handle input by responding to callbacks
34+
attack.performed += ctx => cube.GetComponent<Renderer>().material.color = Color.red;
35+
attack.canceled += ctx => cube.GetComponent<Renderer>().material.color = Color.green;
36+
}
37+
38+
// Update is called once per frame
39+
void Update()
40+
{
41+
// Handle input by polling each frame
42+
var moveVal = move.ReadValue<Vector2>() * 10.0f * Time.deltaTime;
43+
cube.transform.Translate(new Vector3(moveVal.x, moveVal.y, 0));
44+
}
45+
} // class ProjectWideActionsExample
46+
} // namespace UnityEngine.InputSystem.Samples.ProjectWideActions
47+
48+
#endif

0 commit comments

Comments
 (0)