Imported basic unity packages yeehaw
This commit is contained in:
270
Assets/StarterAssets/InputSystem/StarterAssets.inputactions
Normal file
270
Assets/StarterAssets/InputSystem/StarterAssets.inputactions
Normal file
@@ -0,0 +1,270 @@
|
||||
{
|
||||
"name": "StarterAssets",
|
||||
"maps": [
|
||||
{
|
||||
"name": "Player",
|
||||
"id": "f62a4b92-ef5e-4175-8f4c-c9075429d32c",
|
||||
"actions": [
|
||||
{
|
||||
"name": "Move",
|
||||
"type": "Value",
|
||||
"id": "6bc1aaf4-b110-4ff7-891e-5b9fe6f32c4d",
|
||||
"expectedControlType": "Vector2",
|
||||
"processors": "",
|
||||
"interactions": ""
|
||||
},
|
||||
{
|
||||
"name": "Look",
|
||||
"type": "Value",
|
||||
"id": "2690c379-f54d-45be-a724-414123833eb4",
|
||||
"expectedControlType": "Vector2",
|
||||
"processors": "",
|
||||
"interactions": ""
|
||||
},
|
||||
{
|
||||
"name": "Jump",
|
||||
"type": "Button",
|
||||
"id": "8c4abdf8-4099-493a-aa1a-129acec7c3df",
|
||||
"expectedControlType": "Button",
|
||||
"processors": "",
|
||||
"interactions": ""
|
||||
},
|
||||
{
|
||||
"name": "Sprint",
|
||||
"type": "PassThrough",
|
||||
"id": "980e881e-182c-404c-8cbf-3d09fdb48fef",
|
||||
"expectedControlType": "",
|
||||
"processors": "",
|
||||
"interactions": ""
|
||||
}
|
||||
],
|
||||
"bindings": [
|
||||
{
|
||||
"name": "WASD",
|
||||
"id": "b7594ddb-26c9-4ba2-bd5a-901468929edc",
|
||||
"path": "2DVector(mode=1)",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Move",
|
||||
"isComposite": true,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "up",
|
||||
"id": "2063a8b5-6a45-43de-851b-65f3d46e7b58",
|
||||
"path": "<Keyboard>/w",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "KeyboardMouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "down",
|
||||
"id": "64e4d037-32e1-4fb9-80e4-fc7330404dfe",
|
||||
"path": "<Keyboard>/s",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "KeyboardMouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "left",
|
||||
"id": "0fce8b11-5eab-4e4e-a741-b732e7b20873",
|
||||
"path": "<Keyboard>/a",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "KeyboardMouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "right",
|
||||
"id": "7bdda0d6-57a8-47c8-8238-8aecf3110e47",
|
||||
"path": "<Keyboard>/d",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "KeyboardMouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "up",
|
||||
"id": "bb94b405-58d3-4998-8535-d705c1218a98",
|
||||
"path": "<Keyboard>/upArrow",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "KeyboardMouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "down",
|
||||
"id": "929d9071-7dd0-4368-9743-6793bb98087e",
|
||||
"path": "<Keyboard>/downArrow",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "KeyboardMouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "left",
|
||||
"id": "28abadba-06ff-4d37-bb70-af2f1e35a3b9",
|
||||
"path": "<Keyboard>/leftArrow",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "KeyboardMouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "right",
|
||||
"id": "45f115b6-9b4f-4ba8-b500-b94c93bf7d7e",
|
||||
"path": "<Keyboard>/rightArrow",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "KeyboardMouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "e2f9aa65-db06-4c5b-a2e9-41bc8acb9517",
|
||||
"path": "<Gamepad>/leftStick",
|
||||
"interactions": "",
|
||||
"processors": "StickDeadzone",
|
||||
"groups": "Gamepad",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "ed66cbff-2900-4a62-8896-696503cfcd31",
|
||||
"path": "<Pointer>/delta",
|
||||
"interactions": "",
|
||||
"processors": "InvertVector2(invertX=false),ScaleVector2(x=15,y=15)",
|
||||
"groups": "KeyboardMouse",
|
||||
"action": "Look",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "d1d171b6-19d8-47a6-ba3a-71b6a8e7b3c0",
|
||||
"path": "<Gamepad>/rightStick",
|
||||
"interactions": "",
|
||||
"processors": "InvertVector2(invertX=false),StickDeadzone,ScaleVector2(x=300,y=300)",
|
||||
"groups": "Gamepad",
|
||||
"action": "Look",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "1bd55a0b-761e-4ae4-89ae-8ec127e08a29",
|
||||
"path": "<Keyboard>/space",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "KeyboardMouse",
|
||||
"action": "Jump",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "9f973413-5e27-4239-acee-38c4a63feeba",
|
||||
"path": "<Gamepad>/buttonSouth",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "Gamepad",
|
||||
"action": "Jump",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "dc65b89f-9bd3-43fb-92af-d0d87ba5faa4",
|
||||
"path": "<Keyboard>/leftShift",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "KeyboardMouse",
|
||||
"action": "Sprint",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "c8fcd86e-dcfd-4f88-8e93-b638cdbf3320",
|
||||
"path": "<Gamepad>/leftTrigger",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "Gamepad",
|
||||
"action": "Sprint",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"controlSchemes": [
|
||||
{
|
||||
"name": "KeyboardMouse",
|
||||
"bindingGroup": "KeyboardMouse",
|
||||
"devices": [
|
||||
{
|
||||
"devicePath": "<Keyboard>",
|
||||
"isOptional": false,
|
||||
"isOR": false
|
||||
},
|
||||
{
|
||||
"devicePath": "<Mouse>",
|
||||
"isOptional": false,
|
||||
"isOR": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Gamepad",
|
||||
"bindingGroup": "Gamepad",
|
||||
"devices": [
|
||||
{
|
||||
"devicePath": "<Gamepad>",
|
||||
"isOptional": true,
|
||||
"isOR": false
|
||||
},
|
||||
{
|
||||
"devicePath": "<XInputController>",
|
||||
"isOptional": true,
|
||||
"isOR": false
|
||||
},
|
||||
{
|
||||
"devicePath": "<DualShockGamepad>",
|
||||
"isOptional": true,
|
||||
"isOR": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Xbox Controller",
|
||||
"bindingGroup": "Xbox Controller",
|
||||
"devices": []
|
||||
},
|
||||
{
|
||||
"name": "PS4 Controller",
|
||||
"bindingGroup": "PS4 Controller",
|
||||
"devices": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4419d82f33d36e848b3ed5af4c8da37e
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3}
|
||||
generateWrapperCode: 0
|
||||
wrapperCodePath:
|
||||
wrapperClassName:
|
||||
wrapperCodeNamespace:
|
||||
@@ -0,0 +1,26 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
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: 11500000, guid: c46f07b5ed07e4e92aa78254188d3d10, type: 3}
|
||||
m_Name: StarterAssets.inputsettings
|
||||
m_EditorClassIdentifier:
|
||||
m_SupportedDevices: []
|
||||
m_UpdateMode: 2
|
||||
m_CompensateForScreenOrientation: 0
|
||||
m_FilterNoiseOnCurrent: 0
|
||||
m_DefaultDeadzoneMin: 0.125
|
||||
m_DefaultDeadzoneMax: 0.925
|
||||
m_DefaultButtonPressPoint: 0.5
|
||||
m_DefaultTapTime: 0.2
|
||||
m_DefaultSlowTapTime: 0.5
|
||||
m_DefaultHoldTime: 0.4
|
||||
m_TapRadius: 5
|
||||
m_MultiTapDelayTime: 0.75
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e7be553448fa2546aea5752021cbcf7
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
89
Assets/StarterAssets/InputSystem/StarterAssetsInputs.cs
Normal file
89
Assets/StarterAssets/InputSystem/StarterAssetsInputs.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using UnityEngine;
|
||||
#if ENABLE_INPUT_SYSTEM && STARTER_ASSETS_PACKAGES_CHECKED
|
||||
using UnityEngine.InputSystem;
|
||||
#endif
|
||||
|
||||
namespace StarterAssets
|
||||
{
|
||||
public class StarterAssetsInputs : MonoBehaviour
|
||||
{
|
||||
[Header("Character Input Values")]
|
||||
public Vector2 move;
|
||||
public Vector2 look;
|
||||
public bool jump;
|
||||
public bool sprint;
|
||||
|
||||
[Header("Movement Settings")]
|
||||
public bool analogMovement;
|
||||
|
||||
#if !UNITY_IOS || !UNITY_ANDROID
|
||||
[Header("Mouse Cursor Settings")]
|
||||
public bool cursorLocked = true;
|
||||
public bool cursorInputForLook = true;
|
||||
#endif
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM && STARTER_ASSETS_PACKAGES_CHECKED
|
||||
public void OnMove(InputValue value)
|
||||
{
|
||||
MoveInput(value.Get<Vector2>());
|
||||
}
|
||||
|
||||
public void OnLook(InputValue value)
|
||||
{
|
||||
if(cursorInputForLook)
|
||||
{
|
||||
LookInput(value.Get<Vector2>());
|
||||
}
|
||||
}
|
||||
|
||||
public void OnJump(InputValue value)
|
||||
{
|
||||
JumpInput(value.isPressed);
|
||||
}
|
||||
|
||||
public void OnSprint(InputValue value)
|
||||
{
|
||||
SprintInput(value.isPressed);
|
||||
}
|
||||
#else
|
||||
// old input sys if we do decide to have it (most likely wont)...
|
||||
#endif
|
||||
|
||||
|
||||
public void MoveInput(Vector2 newMoveDirection)
|
||||
{
|
||||
move = newMoveDirection;
|
||||
}
|
||||
|
||||
public void LookInput(Vector2 newLookDirection)
|
||||
{
|
||||
look = newLookDirection;
|
||||
}
|
||||
|
||||
public void JumpInput(bool newJumpState)
|
||||
{
|
||||
jump = newJumpState;
|
||||
}
|
||||
|
||||
public void SprintInput(bool newSprintState)
|
||||
{
|
||||
sprint = newSprintState;
|
||||
}
|
||||
|
||||
#if !UNITY_IOS || !UNITY_ANDROID
|
||||
|
||||
private void OnApplicationFocus(bool hasFocus)
|
||||
{
|
||||
SetCursorState(cursorLocked);
|
||||
}
|
||||
|
||||
private void SetCursorState(bool newState)
|
||||
{
|
||||
Cursor.lockState = newState ? CursorLockMode.Locked : CursorLockMode.None;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/StarterAssets/InputSystem/StarterAssetsInputs.cs.meta
Normal file
11
Assets/StarterAssets/InputSystem/StarterAssetsInputs.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e087ecce43ebbff45a1b360637807d93
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user