Skip to content

Commit

Permalink
InputActionを新しく作った
Browse files Browse the repository at this point in the history
勉強になった。
  • Loading branch information
RyoRyo-2010 committed Nov 11, 2023
1 parent 0cd9bdf commit f8d7c4e
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 64 deletions.
8 changes: 8 additions & 0 deletions Assets/InputActionAssets.meta

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

122 changes: 122 additions & 0 deletions Assets/InputActionAssets/InputAcrion.inputactions
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"name": "InputAcrion",
"maps": [
{
"name": "Dog",
"id": "de6714dd-50e7-46bf-bacd-f6f2e8df64ee",
"actions": [
{
"name": "Jump",
"type": "Button",
"id": "6572da62-7131-4d7f-9b06-a59105f9444c",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
}
],
"bindings": [
{
"name": "",
"id": "be7cc276-eaba-4d42-86b2-26e47dec709e",
"path": "<Joystick>/trigger",
"interactions": "",
"processors": "",
"groups": "Gamepad&Joystick",
"action": "Jump",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "5db50255-e194-43ef-9b95-e8dddc95abdb",
"path": "<Keyboard>/space",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Jump",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "28f64d51-469a-4545-91a0-5936e1f56ef1",
"path": "<Mouse>/leftButton",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Jump",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "e5fb56a2-cfd8-4eb7-a5ce-c180bab5ad8a",
"path": "<Touchscreen>/primaryTouch/press",
"interactions": "",
"processors": "",
"groups": "Touch",
"action": "Jump",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "d97e8fd4-94d7-46fa-a2a0-a5fa5a81e6d1",
"path": "<Gamepad>/rightTrigger",
"interactions": "",
"processors": "",
"groups": "Gamepad&Joystick",
"action": "Jump",
"isComposite": false,
"isPartOfComposite": false
}
]
}
],
"controlSchemes": [
{
"name": "Gamepad&Joystick",
"bindingGroup": "Gamepad&Joystick",
"devices": [
{
"devicePath": "<Joystick>",
"isOptional": false,
"isOR": false
},
{
"devicePath": "<Gamepad>",
"isOptional": false,
"isOR": false
}
]
},
{
"name": "Touch",
"bindingGroup": "Touch",
"devices": [
{
"devicePath": "<Touchscreen>",
"isOptional": false,
"isOR": false
}
]
},
{
"name": "Keyboard&Mouse",
"bindingGroup": "Keyboard&Mouse",
"devices": [
{
"devicePath": "<Keyboard>",
"isOptional": false,
"isOR": false
},
{
"devicePath": "<Mouse>",
"isOptional": false,
"isOR": false
}
]
}
]
}
14 changes: 14 additions & 0 deletions Assets/InputActionAssets/InputAcrion.inputactions.meta

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

45 changes: 45 additions & 0 deletions Assets/Scenes/CheckScores.unity
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,51 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1661654155
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1661654157}
- component: {fileID: 1661654156}
m_Layer: 0
m_Name: ScoreManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1661654156
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1661654155}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0b019bcd40014b14fb8d184195bd64dd, type: 3}
m_Name:
m_EditorClassIdentifier:
FirstJson: {fileID: 0}
ScoreText: {fileID: 0}
--- !u!4 &1661654157
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1661654155}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.24615109, y: 5.6095953, z: -32.115463}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1694340996
GameObject:
m_ObjectHideFlags: 0
Expand Down
69 changes: 5 additions & 64 deletions Assets/Scenes/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Actions: {fileID: -944628639613478452, guid: ed224f8046bfe0b459e1431b7afe5857, type: 3}
m_Actions: {fileID: -944628639613478452, guid: 0ba1237dcfb0515419e8cbee3dec05d7, type: 3}
m_NotificationBehavior: 2
m_UIInputModule: {fileID: 0}
m_DeviceLostEvent:
Expand All @@ -609,26 +609,6 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_ActionEvents:
- m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 731921429}
m_TargetAssemblyTypeName: DogJump, Assembly-CSharp
m_MethodName: OnMove
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_ActionId: 8646b808-1981-426e-bc43-e230344ab0b6
m_ActionName: Player/Move[/Keyboard/w,/Keyboard/upArrow,/Keyboard/s,/Keyboard/downArrow,/Keyboard/a,/Keyboard/leftArrow,/Keyboard/d,/Keyboard/rightArrow]
- m_PersistentCalls:
m_Calls: []
m_ActionId: 806d10f6-3ec4-4648-b9b0-612d401206ff
m_ActionName: Player/Look[/Mouse/delta,/Pen/delta]
- m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 731921429}
Expand All @@ -643,51 +623,12 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_ActionId: 30c410d7-8953-46e8-9474-033ec5efa0fa
m_ActionName: Player/Fire[/Mouse/leftButton]
- m_PersistentCalls:
m_Calls: []
m_ActionId: efd4b601-9140-4afd-9104-cb7647ef9df8
m_ActionName: UI/Navigate[/Keyboard/w,/Keyboard/upArrow,/Keyboard/s,/Keyboard/downArrow,/Keyboard/a,/Keyboard/leftArrow,/Keyboard/d,/Keyboard/rightArrow]
- m_PersistentCalls:
m_Calls: []
m_ActionId: 76ddf261-a4d1-4b84-b996-b80e3a3f9ff8
m_ActionName: UI/Submit[/Keyboard/enter]
- m_PersistentCalls:
m_Calls: []
m_ActionId: 3404288b-1265-4a20-ac30-298303a3cc5f
m_ActionName: UI/Cancel[/Keyboard/escape]
- m_PersistentCalls:
m_Calls: []
m_ActionId: 43c09efd-b8f9-43a9-aa76-34b67a31a598
m_ActionName: UI/Point[/Mouse/position,/Pen/position]
- m_PersistentCalls:
m_Calls: []
m_ActionId: a911ea93-b596-4942-a092-833ac9b8ae64
m_ActionName: UI/Click[/Mouse/leftButton,/Pen/tip]
- m_PersistentCalls:
m_Calls: []
m_ActionId: 1eb3db5a-4666-44cf-8473-fd518b490462
m_ActionName: UI/ScrollWheel[/Mouse/scroll]
- m_PersistentCalls:
m_Calls: []
m_ActionId: 131c480b-9d52-43fb-83da-155e8909c71c
m_ActionName: UI/MiddleClick[/Mouse/middleButton]
- m_PersistentCalls:
m_Calls: []
m_ActionId: 05f88361-03e7-46b8-8520-ac31a5f8fce8
m_ActionName: UI/RightClick[/Mouse/rightButton]
- m_PersistentCalls:
m_Calls: []
m_ActionId: d29288ac-5afd-40cf-ae95-3641bef9fe27
m_ActionName: UI/TrackedDevicePosition
- m_PersistentCalls:
m_Calls: []
m_ActionId: 7bb60176-b404-450f-aef2-f791a004ecef
m_ActionName: UI/TrackedDeviceOrientation
m_ActionId: 6572da62-7131-4d7f-9b06-a59105f9444c
m_ActionName: Dog/Jump[/Nintendo Wireless Gamepad/trigger,/Nintendo Wireless
Gamepad1/trigger,/Nintendo Wireless Gamepad2/trigger,/Keyboard/space,/Mouse/leftButton]
m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme:
m_DefaultActionMap: Player
m_DefaultActionMap: Dog
m_SplitScreenIndex: -1
m_Camera: {fileID: 0}
--- !u!1 &774529984
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/Game/DogJump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void OnMove(InputAction.CallbackContext context)

public void OnJump(InputAction.CallbackContext context)
{
Debug.Log("OnJump");
if (context.phase == InputActionPhase.Performed)
{
if (Jumpable)
Expand Down

0 comments on commit f8d7c4e

Please sign in to comment.