Skip to content

Commit a830638

Browse files
committed
Merge branch 'develop' into stable
2 parents e299891 + e25e307 commit a830638

File tree

91 files changed

+2660
-148
lines changed

Some content is hidden

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

91 files changed

+2660
-148
lines changed

Assets/Samples/CustomComposite/CustomComposite.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public override void OnGUI()
177177
target.scaleFactor = EditorGUILayout.Slider(m_ScaleFactorLabel, currentValue, 0, 2);
178178
}
179179

180-
#if UNITY_INPUT_SYSTEM_UI_TK_ASSET_EDITOR
180+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
181181
public override void OnDrawVisualElements(VisualElement root, Action onChangedCallback)
182182
{
183183
var slider = new Slider(m_ScaleFactorLabel.text, 0, 2)

Assets/Samples/InGameHints/InGameHintsActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.7.0
4+
// version 1.8.0
55
// from Assets/Samples/InGameHints/InGameHintsActions.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Assets/Samples/ProjectWideActionsTest.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "ProjectWideActionsTest",
3+
"rootNamespace": "",
4+
"references": [
5+
"GUID:75469ad4d38634e559750d17036d5f7c"
6+
],
7+
"includePlatforms": [],
8+
"excludePlatforms": [],
9+
"allowUnsafeCode": false,
10+
"overrideReferences": false,
11+
"precompiledReferences": [],
12+
"autoReferenced": true,
13+
"defineConstraints": [],
14+
"versionDefines": [
15+
{
16+
"name": "Unity",
17+
"expression": "2022.3",
18+
"define": "UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS"
19+
}
20+
],
21+
"noEngineReferences": false
22+
}

Assets/Samples/ProjectWideActionsTest/ProjectWideActionsTest.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
2+
3+
using UnityEngine;
4+
using UnityEngine.InputSystem;
5+
6+
public class NewBehaviourScript : MonoBehaviour
7+
{
8+
[SerializeField] public GameObject cube;
9+
10+
InputAction move;
11+
InputAction look;
12+
InputAction attack;
13+
InputAction jump;
14+
InputAction interact;
15+
InputAction next;
16+
InputAction previous;
17+
InputAction sprint;
18+
InputAction crouch;
19+
20+
// Start is called before the first frame update
21+
void Start()
22+
{
23+
// Project-Wide Actions
24+
move = InputSystem.actions.FindAction("Player/Move");
25+
look = InputSystem.actions.FindAction("Player/Look");
26+
attack = InputSystem.actions.FindAction("Player/Attack");
27+
jump = InputSystem.actions.FindAction("Player/Jump");
28+
interact = InputSystem.actions.FindAction("Player/Interact");
29+
next = InputSystem.actions.FindAction("Player/Next");
30+
previous = InputSystem.actions.FindAction("Player/Previous");
31+
sprint = InputSystem.actions.FindAction("Player/Sprint");
32+
crouch = InputSystem.actions.FindAction("Player/Crouch");
33+
}
34+
35+
// Update is called once per frame
36+
void Update()
37+
{
38+
if (attack.WasPressedThisFrame())
39+
{
40+
cube.GetComponent<Renderer>().material.color = Color.red;
41+
}
42+
else if (attack.WasReleasedThisFrame())
43+
{
44+
cube.GetComponent<Renderer>().material.color = Color.green;
45+
}
46+
47+
var moveVal = move.ReadValue<Vector2>();
48+
if (moveVal.x < 0.0f)
49+
{
50+
cube.transform.Translate(new Vector3(-10 * Time.deltaTime, 0, 0));
51+
}
52+
else if (moveVal.x > 0.0f)
53+
{
54+
cube.transform.Translate(new Vector3(10 * Time.deltaTime, 0, 0));
55+
}
56+
if (moveVal.y < 0.0f)
57+
{
58+
cube.transform.Translate(new Vector3(0, -10 * Time.deltaTime, 0));
59+
}
60+
else if (moveVal.y > 0.0f)
61+
{
62+
cube.transform.Translate(new Vector3(0, 10 * Time.deltaTime, 0));
63+
}
64+
}
65+
}
66+
#endif

Assets/Samples/ProjectWideActionsTest/ProjectWideActionsTest.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)