Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 53
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 15011, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier: UnityEditor.dll::UnityEditor.GridSettings
m_ActiveModeIndex: 0
m_GridModes:
- rid: 35489430871212034
- rid: 35489430871212035
m_GridSize: {x: 1, y: 1, z: 1}
m_GridMultiplier: 0
references:
version: 2
RefIds:
- rid: 35489430871212034
type: {class: WorldGridMode, ns: UnityEditor, asm: UnityEditor.CoreModule}
data:
- rid: 35489430871212035
type: {class: CustomGridMode, ns: UnityEditor, asm: UnityEditor.CoreModule}
data:
m_Position: {x: 0, y: 0, z: 0}
m_Rotation: {x: 0, y: 0, z: 0, w: 1}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 53
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 13954, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier: UnityEditor.dll::UnityEditor.EditorSnapSettingsData
m_SnapEnabled: 0
m_AngleSnapEnabled: 0
m_ScaleSnapEnabled: 0
m_SnapSettings:
m_SnapToGrid: 1
m_Rotation: 15
m_Scale: 1
m_IncrementalSnapSize: {x: 0.25, y: 0.25, z: 0.25}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 53
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 15008, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier: UnityEditor.dll::UnityEditor.EditorToolsSettingsData
m_DefaultState:
m_StateToolOwnerTypeName: UnityEditor.SceneView, UnityEditor.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_GroupsSettingsList:
- groupType: UnityEngine.CircleCollider2D, UnityEngine.Physics2DModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.HingeJoint2D, UnityEngine.Physics2DModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.BoxCollider2D, UnityEngine.Physics2DModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.PolygonCollider2D, UnityEngine.Physics2DModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.EdgeCollider2D, UnityEngine.Physics2DModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.CapsuleCollider2D, UnityEngine.Physics2DModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.ArticulationBody, UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.CharacterJoint, UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.CapsuleCollider, UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.ConfigurableJoint, UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.HingeJoint, UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.BoxCollider, UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.SphereCollider, UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.LightProbeGroup, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.ParticleSystem, UnityEngine.ParticleSystemModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.LightProbeProxyVolume, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.LineRenderer, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
- groupType: UnityEngine.TrailRenderer, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
collapsed: 0
m_LastPivotModeTypeString: UnityEditor.CenterPivotMode, UnityEditor.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_LastPivotRotationTypeString: UnityEditor.LocalPivotRotation, UnityEditor.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_CustomStates: []
m_GroupsSettingsList: []
m_LastPivotModeTypeString:
m_LastPivotRotationTypeString:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sceneSetups: []
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"cameraMode":{"drawMode":0,"name":"Shaded","section":"Shading Mode"},"sceneLighting":true,"audioPlay":false,"sceneViewState":{"m_AlwaysRefresh":false,"showFog":true,"showSkybox":true,"showFlares":true,"showImageEffects":true,"showParticleSystems":true,"showVisualEffectGraphs":true,"m_FxEnabled":true},"in2DMode":false,"pivot":{"x":0.0,"y":0.0,"z":0.0},"rotation":{"x":-0.08717229217290878,"y":0.8995905518531799,"z":-0.21045254170894623,"w":-0.37262260913848877},"size":10.0,"orthographic":false}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"ValidContent": 8,
"ViewModelState": [],
"SearchText": "",
"Columns": [
{
"ColumnId": "Visibility",
"Visible": true,
"Width": 20.0,
"Index": 0
},
{
"ColumnId": "Picking",
"Visible": true,
"Width": 20.0,
"Index": 1
},
{
"ColumnId": "HierarchyViewColumn Name",
"Visible": true,
"Width": 231.60000610351563,
"Index": 2
},
{
"ColumnId": "GameObject/Active",
"Visible": false,
"Width": 50.0,
"Index": 3
},
{
"ColumnId": "HierarchyViewColumn Navigate",
"Visible": true,
"Width": 18.0,
"Index": 3
},
{
"ColumnId": "GameObject/Static",
"Visible": false,
"Width": 75.0,
"Index": 5
},
{
"ColumnId": "GameObject/Layer",
"Visible": false,
"Width": 150.0,
"Index": 6
},
{
"ColumnId": "GameObject/Tag",
"Visible": false,
"Width": 100.0,
"Index": 7
}
],
"ScrollPositionX": -1.0,
"ScrollPositionY": -1.0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using UnityEngine;
using UnityEngine.InputSystem;

/// <summary>
/// Example script demonstrating how to look up a project-wide action.
/// </summary>
public class AboutProjectWideActions : MonoBehaviour
{
void Start()
{

Check warning on line 10 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/AboutProjectWideActions.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/AboutProjectWideActions.cs#L10

Added line #L10 was not covered by tests
#region about-project-wide-actions
InputSystem.actions.FindAction("Move");

Check warning on line 12 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/AboutProjectWideActions.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/AboutProjectWideActions.cs#L12

Added line #L12 was not covered by tests
#endregion
}

Check warning on line 14 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/AboutProjectWideActions.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/AboutProjectWideActions.cs#L14

Added line #L14 was not covered by tests
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using UnityEngine;
using UnityEngine.InputSystem;

class BindingConflictsExample
{
public void Example()
{

Check warning on line 7 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs#L7

Added line #L7 was not covered by tests
#region bindingConflicts
// Create two actions in the same map.
var map = new InputActionMap();
var bAction = map.AddAction("B");
var shiftbAction = map.AddAction("ShiftB");

Check warning on line 12 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs#L10-L12

Added lines #L10 - L12 were not covered by tests

// Bind one of the actions to 'B' and the other to 'SHIFT+B'.
bAction.AddBinding("<Keyboard>/b");
shiftbAction.AddCompositeBinding("OneModifier")

Check warning on line 16 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs#L15-L16

Added lines #L15 - L16 were not covered by tests
.With("Modifier", "<Keyboard>/shift")
.With("Binding", "<Keyboard>/b");

// Print something to the console when the actions are triggered.
bAction.performed += _ => Debug.Log("B action performed");
shiftbAction.performed += _ => Debug.Log("SHIFT+B action performed");

Check warning on line 22 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs#L21-L22

Added lines #L21 - L22 were not covered by tests

// Start listening to input.
map.Enable();

Check warning on line 25 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs#L25

Added line #L25 was not covered by tests

var keyboard = Keyboard.current ?? InputSystem.AddDevice<Keyboard>();

Check warning on line 27 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs#L27

Added line #L27 was not covered by tests

// Now, let's assume the left shift key on the keyboard is pressed (here, we manually
// press it by queueing a state event for the control).
InputSystem.QueueDeltaStateEvent(keyboard.leftShiftKey, 1f);
InputSystem.Update();

Check warning on line 32 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs#L31-L32

Added lines #L31 - L32 were not covered by tests

// And then the B is pressed. This is a valid input for both
// bAction as well as shiftbAction.
//
// What will happen now is that shiftbAction will do its processing first. In response,
// it will *perform* the action (That is, we see the `performed` callback being invoked) and
// thus "consume" the input. bAction will stay silent as it will in turn be skipped over.
InputSystem.QueueDeltaStateEvent(keyboard.bKey, 1f);
InputSystem.Update();

Check warning on line 41 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs#L40-L41

Added lines #L40 - L41 were not covered by tests
#endregion
}

Check warning on line 43 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/BindingConflicts.cs#L43

Added line #L43 was not covered by tests
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
namespace DocCodeSamples.Tests
{
#region declaration
using UnityEngine;
using UnityEngine.InputSystem;

/// <summary>
/// Example script exposing serialized action references.
/// </summary>
public class ExampleScript : MonoBehaviour
{
/// <summary>
/// Reference to the "move" action.
/// </summary>
public InputAction move;

/// <summary>
/// Reference to the "jump" action.
/// </summary>
public InputAction jump;
}
#endregion

class ConfigureInputfromCode : MonoBehaviour
{
const string json = @"
{
""maps"" : [
{
""name"" : ""gameplay"",
""actions"" : [
{ ""name"" : ""fire"", ""type"" : ""button"" }
]
}
]
}";

void ConfigureFromJsonExample()
{

Check warning on line 39 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L39

Added line #L39 was not covered by tests
#region configurefromjson
// Load a set of action maps from JSON.
var maps = InputActionMap.FromJson(json);

Check warning on line 42 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L42

Added line #L42 was not covered by tests

// Load an entire InputActionAsset from JSON.
var asset = InputActionAsset.FromJson(json);

Check warning on line 45 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L45

Added line #L45 was not covered by tests
#endregion
}

Check warning on line 47 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L47

Added line #L47 was not covered by tests

void Start()
{

Check warning on line 50 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L50

Added line #L50 was not covered by tests
#region configurefromcode
{

Check warning on line 52 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L52

Added line #L52 was not covered by tests
// Create free-standing actions.
var lookAction = new InputAction("look", binding: "<Gamepad>/leftStick");
var moveAction = new InputAction("move", binding: "<Gamepad>/rightStick");

Check warning on line 55 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L54-L55

Added lines #L54 - L55 were not covered by tests

moveAction.AddCompositeBinding("1DAxis")

Check warning on line 57 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L57

Added line #L57 was not covered by tests
.With("Left", "<Keyboard>/a")
.With("Right", "<Keyboard>/d");
}

Check warning on line 60 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L60

Added line #L60 was not covered by tests

{

Check warning on line 62 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L62

Added line #L62 was not covered by tests
// Create an action map with actions.
var map = new InputActionMap("Gameplay");
var lookAction = map.AddAction("look");
lookAction.AddBinding("<Gamepad>/leftStick");
}

Check warning on line 67 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L64-L67

Added lines #L64 - L67 were not covered by tests

{

Check warning on line 69 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L69

Added line #L69 was not covered by tests
// Create an action asset.
var asset = ScriptableObject.CreateInstance<InputActionAsset>();
var gameplayMap = new InputActionMap("gameplay");
asset.AddActionMap(gameplayMap);
var lookAction = gameplayMap.AddAction("look", binding: "<Gamepad>/leftStick");
}

Check warning on line 75 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L71-L75

Added lines #L71 - L75 were not covered by tests
#endregion
}

Check warning on line 77 in Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/DocCodeSamples.Tests/ConfigureInputfromCode.cs#L77

Added line #L77 was not covered by tests
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading