Pull request #7: Grapple uses new input system
Merge in CEGJ/32bit_jam_conjure from grappling to Dev * commit '39283354c12a522f7d6f637b848429009ff02fd4': Grapple uses new input system
This commit is contained in:
commit
45ae623028
@ -22,6 +22,42 @@
|
|||||||
"processors": "",
|
"processors": "",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"initialStateCheck": false
|
"initialStateCheck": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ShootGrapple",
|
||||||
|
"type": "Button",
|
||||||
|
"id": "7d1c4cb5-032a-4799-ac7b-841a778c389d",
|
||||||
|
"expectedControlType": "Button",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Aim",
|
||||||
|
"type": "Value",
|
||||||
|
"id": "abdcd477-96c8-41e2-a4ff-70e14e18f036",
|
||||||
|
"expectedControlType": "Stick",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BoostToAnchor",
|
||||||
|
"type": "Button",
|
||||||
|
"id": "dcc9ba8a-9503-43ef-a481-d6fc1abc5880",
|
||||||
|
"expectedControlType": "Button",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RaiseLowerGrapple",
|
||||||
|
"type": "Value",
|
||||||
|
"id": "098de720-4946-4b02-bafc-25d0f86614c6",
|
||||||
|
"expectedControlType": "Vector2",
|
||||||
|
"processors": "",
|
||||||
|
"interactions": "",
|
||||||
|
"initialStateCheck": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"bindings": [
|
"bindings": [
|
||||||
@ -42,7 +78,7 @@
|
|||||||
"path": "<Keyboard>/a",
|
"path": "<Keyboard>/a",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": "",
|
"groups": "KbMouse",
|
||||||
"action": "Walk",
|
"action": "Walk",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@ -53,7 +89,7 @@
|
|||||||
"path": "<Keyboard>/d",
|
"path": "<Keyboard>/d",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": "",
|
"groups": "KbMouse",
|
||||||
"action": "Walk",
|
"action": "Walk",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@ -75,7 +111,7 @@
|
|||||||
"path": "<Gamepad>/leftStick/left",
|
"path": "<Gamepad>/leftStick/left",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": "",
|
"groups": "Controller",
|
||||||
"action": "Walk",
|
"action": "Walk",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@ -86,7 +122,7 @@
|
|||||||
"path": "<Gamepad>/leftStick/right",
|
"path": "<Gamepad>/leftStick/right",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": "",
|
"groups": "Controller",
|
||||||
"action": "Walk",
|
"action": "Walk",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": true
|
"isPartOfComposite": true
|
||||||
@ -97,7 +133,7 @@
|
|||||||
"path": "<Keyboard>/space",
|
"path": "<Keyboard>/space",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": "",
|
"groups": "KbMouse",
|
||||||
"action": "Jump",
|
"action": "Jump",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": false
|
"isPartOfComposite": false
|
||||||
@ -108,13 +144,173 @@
|
|||||||
"path": "<Gamepad>/buttonSouth",
|
"path": "<Gamepad>/buttonSouth",
|
||||||
"interactions": "",
|
"interactions": "",
|
||||||
"processors": "",
|
"processors": "",
|
||||||
"groups": "",
|
"groups": "Controller",
|
||||||
"action": "Jump",
|
"action": "Jump",
|
||||||
"isComposite": false,
|
"isComposite": false,
|
||||||
"isPartOfComposite": false
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "6225d149-59ab-4d2b-a2b2-69d5b4645d82",
|
||||||
|
"path": "<Mouse>/leftButton",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "KbMouse",
|
||||||
|
"action": "ShootGrapple",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "38f6cedc-071c-4877-8e72-b049b21630c2",
|
||||||
|
"path": "<Gamepad>/rightShoulder",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Controller",
|
||||||
|
"action": "ShootGrapple",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "776e6b77-14f7-44b1-9fc2-74a9f3c8ade6",
|
||||||
|
"path": "<Mouse>/rightButton",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "KbMouse",
|
||||||
|
"action": "BoostToAnchor",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "17a9963e-75c6-4ed1-b465-9f1d8980cc97",
|
||||||
|
"path": "<Gamepad>/leftShoulder",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Controller",
|
||||||
|
"action": "BoostToAnchor",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "02c5844d-52af-4ca0-84cd-81cbf06b9704",
|
||||||
|
"path": "<Mouse>/position",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "KbMouse",
|
||||||
|
"action": "Aim",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"id": "b78276ec-3ba3-410f-aecb-c27c55ebe8ee",
|
||||||
|
"path": "<Gamepad>/rightStick",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Controller",
|
||||||
|
"action": "Aim",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Keyboard",
|
||||||
|
"id": "854da752-1671-4b03-8eab-d35ab5304d5f",
|
||||||
|
"path": "2DVector",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "RaiseLowerGrapple",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "up",
|
||||||
|
"id": "abcae2c6-de84-4ff5-b033-7c34dc7bae18",
|
||||||
|
"path": "<Keyboard>/w",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "KbMouse",
|
||||||
|
"action": "RaiseLowerGrapple",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "down",
|
||||||
|
"id": "3869f5f4-1a4f-4617-bf77-fa17b0bd86b9",
|
||||||
|
"path": "<Keyboard>/s",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "KbMouse",
|
||||||
|
"action": "RaiseLowerGrapple",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Controller",
|
||||||
|
"id": "b9cef357-d60f-49c5-a7d9-ba98b504395a",
|
||||||
|
"path": "2DVector",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "",
|
||||||
|
"action": "RaiseLowerGrapple",
|
||||||
|
"isComposite": true,
|
||||||
|
"isPartOfComposite": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "up",
|
||||||
|
"id": "1dff5618-42af-45e8-a10e-3740b430be39",
|
||||||
|
"path": "<Gamepad>/leftStick/up",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Controller",
|
||||||
|
"action": "RaiseLowerGrapple",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "down",
|
||||||
|
"id": "d6d557d9-8f93-4daf-8e48-fdb94da228e7",
|
||||||
|
"path": "<Gamepad>/leftStick/down",
|
||||||
|
"interactions": "",
|
||||||
|
"processors": "",
|
||||||
|
"groups": "Controller",
|
||||||
|
"action": "RaiseLowerGrapple",
|
||||||
|
"isComposite": false,
|
||||||
|
"isPartOfComposite": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"controlSchemes": []
|
"controlSchemes": [
|
||||||
|
{
|
||||||
|
"name": "KbMouse",
|
||||||
|
"bindingGroup": "KbMouse",
|
||||||
|
"devices": [
|
||||||
|
{
|
||||||
|
"devicePath": "<Keyboard>",
|
||||||
|
"isOptional": false,
|
||||||
|
"isOR": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"devicePath": "<Mouse>",
|
||||||
|
"isOptional": false,
|
||||||
|
"isOR": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Controller",
|
||||||
|
"bindingGroup": "Controller",
|
||||||
|
"devices": [
|
||||||
|
{
|
||||||
|
"devicePath": "<Gamepad>",
|
||||||
|
"isOptional": false,
|
||||||
|
"isOR": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
@ -236,7 +236,7 @@ GameObject:
|
|||||||
- component: {fileID: 111805109}
|
- component: {fileID: 111805109}
|
||||||
- component: {fileID: 111805108}
|
- component: {fileID: 111805108}
|
||||||
- component: {fileID: 111805107}
|
- component: {fileID: 111805107}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_15
|
m_Name: Floor_15
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -333,7 +333,7 @@ GameObject:
|
|||||||
- component: {fileID: 206662346}
|
- component: {fileID: 206662346}
|
||||||
- component: {fileID: 206662345}
|
- component: {fileID: 206662345}
|
||||||
- component: {fileID: 206662344}
|
- component: {fileID: 206662344}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_07
|
m_Name: Floor_07
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -430,7 +430,7 @@ GameObject:
|
|||||||
- component: {fileID: 284892230}
|
- component: {fileID: 284892230}
|
||||||
- component: {fileID: 284892229}
|
- component: {fileID: 284892229}
|
||||||
- component: {fileID: 284892228}
|
- component: {fileID: 284892228}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_16
|
m_Name: Floor_16
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -527,7 +527,7 @@ GameObject:
|
|||||||
- component: {fileID: 335131027}
|
- component: {fileID: 335131027}
|
||||||
- component: {fileID: 335131026}
|
- component: {fileID: 335131026}
|
||||||
- component: {fileID: 335131025}
|
- component: {fileID: 335131025}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_09
|
m_Name: Floor_09
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -612,89 +612,6 @@ MeshFilter:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 335131023}
|
m_GameObject: {fileID: 335131023}
|
||||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
--- !u!1 &375191780
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 375191781}
|
|
||||||
- component: {fileID: 375191784}
|
|
||||||
- component: {fileID: 375191783}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: HitMarker
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 0
|
|
||||||
--- !u!4 &375191781
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 375191780}
|
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
||||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
|
||||||
m_ConstrainProportionsScale: 1
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 1211811540}
|
|
||||||
m_RootOrder: 1
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!23 &375191783
|
|
||||||
MeshRenderer:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 375191780}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_CastShadows: 1
|
|
||||||
m_ReceiveShadows: 1
|
|
||||||
m_DynamicOccludee: 1
|
|
||||||
m_StaticShadowCaster: 0
|
|
||||||
m_MotionVectors: 1
|
|
||||||
m_LightProbeUsage: 1
|
|
||||||
m_ReflectionProbeUsage: 1
|
|
||||||
m_RayTracingMode: 2
|
|
||||||
m_RayTraceProcedural: 0
|
|
||||||
m_RenderingLayerMask: 1
|
|
||||||
m_RendererPriority: 0
|
|
||||||
m_Materials:
|
|
||||||
- {fileID: 2100000, guid: ad6dbe9c8ba98c241abb07659b3fbf37, type: 2}
|
|
||||||
m_StaticBatchInfo:
|
|
||||||
firstSubMesh: 0
|
|
||||||
subMeshCount: 0
|
|
||||||
m_StaticBatchRoot: {fileID: 0}
|
|
||||||
m_ProbeAnchor: {fileID: 0}
|
|
||||||
m_LightProbeVolumeOverride: {fileID: 0}
|
|
||||||
m_ScaleInLightmap: 1
|
|
||||||
m_ReceiveGI: 1
|
|
||||||
m_PreserveUVs: 0
|
|
||||||
m_IgnoreNormalsForChartDetection: 0
|
|
||||||
m_ImportantGI: 0
|
|
||||||
m_StitchLightmapSeams: 1
|
|
||||||
m_SelectedEditorRenderState: 3
|
|
||||||
m_MinimumChartSize: 4
|
|
||||||
m_AutoUVMaxDistance: 0.5
|
|
||||||
m_AutoUVMaxAngle: 89
|
|
||||||
m_LightmapParameters: {fileID: 0}
|
|
||||||
m_SortingLayerID: 0
|
|
||||||
m_SortingLayer: 0
|
|
||||||
m_SortingOrder: 0
|
|
||||||
m_AdditionalVertexStreams: {fileID: 0}
|
|
||||||
--- !u!33 &375191784
|
|
||||||
MeshFilter:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 375191780}
|
|
||||||
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
|
|
||||||
--- !u!1 &455582639
|
--- !u!1 &455582639
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -707,7 +624,7 @@ GameObject:
|
|||||||
- component: {fileID: 455582643}
|
- component: {fileID: 455582643}
|
||||||
- component: {fileID: 455582642}
|
- component: {fileID: 455582642}
|
||||||
- component: {fileID: 455582641}
|
- component: {fileID: 455582641}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_06
|
m_Name: Floor_06
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -804,7 +721,7 @@ GameObject:
|
|||||||
- component: {fileID: 561001799}
|
- component: {fileID: 561001799}
|
||||||
- component: {fileID: 561001798}
|
- component: {fileID: 561001798}
|
||||||
- component: {fileID: 561001797}
|
- component: {fileID: 561001797}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_11
|
m_Name: Floor_11
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -1083,7 +1000,7 @@ GameObject:
|
|||||||
- component: {fileID: 749443137}
|
- component: {fileID: 749443137}
|
||||||
- component: {fileID: 749443136}
|
- component: {fileID: 749443136}
|
||||||
- component: {fileID: 749443135}
|
- component: {fileID: 749443135}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_08
|
m_Name: Floor_08
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -1230,7 +1147,7 @@ GameObject:
|
|||||||
- component: {fileID: 840320355}
|
- component: {fileID: 840320355}
|
||||||
- component: {fileID: 840320354}
|
- component: {fileID: 840320354}
|
||||||
- component: {fileID: 840320353}
|
- component: {fileID: 840320353}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_03
|
m_Name: Floor_03
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -1327,7 +1244,7 @@ GameObject:
|
|||||||
- component: {fileID: 899030645}
|
- component: {fileID: 899030645}
|
||||||
- component: {fileID: 899030644}
|
- component: {fileID: 899030644}
|
||||||
- component: {fileID: 899030643}
|
- component: {fileID: 899030643}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_04
|
m_Name: Floor_04
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -1539,7 +1456,7 @@ GameObject:
|
|||||||
- component: {fileID: 952326955}
|
- component: {fileID: 952326955}
|
||||||
- component: {fileID: 952326954}
|
- component: {fileID: 952326954}
|
||||||
- component: {fileID: 952326953}
|
- component: {fileID: 952326953}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_02
|
m_Name: Floor_02
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -1636,7 +1553,7 @@ GameObject:
|
|||||||
- component: {fileID: 1070079040}
|
- component: {fileID: 1070079040}
|
||||||
- component: {fileID: 1070079039}
|
- component: {fileID: 1070079039}
|
||||||
- component: {fileID: 1070079038}
|
- component: {fileID: 1070079038}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_13
|
m_Name: Floor_13
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -1860,7 +1777,7 @@ GameObject:
|
|||||||
- component: {fileID: 1166806161}
|
- component: {fileID: 1166806161}
|
||||||
- component: {fileID: 1166806160}
|
- component: {fileID: 1166806160}
|
||||||
- component: {fileID: 1166806159}
|
- component: {fileID: 1166806159}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_05
|
m_Name: Floor_05
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -1959,6 +1876,8 @@ GameObject:
|
|||||||
- component: {fileID: 1211811537}
|
- component: {fileID: 1211811537}
|
||||||
- component: {fileID: 1211811541}
|
- component: {fileID: 1211811541}
|
||||||
- component: {fileID: 1211811542}
|
- component: {fileID: 1211811542}
|
||||||
|
- component: {fileID: 1211811543}
|
||||||
|
- component: {fileID: 1211811544}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Player
|
m_Name: Player
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -2042,7 +1961,6 @@ Transform:
|
|||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1882391194}
|
- {fileID: 1882391194}
|
||||||
- {fileID: 375191781}
|
|
||||||
- {fileID: 2098497450}
|
- {fileID: 2098497450}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 3
|
m_RootOrder: 3
|
||||||
@ -2055,13 +1973,13 @@ Rigidbody:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1211811536}
|
m_GameObject: {fileID: 1211811536}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Mass: 1
|
m_Mass: 2
|
||||||
m_Drag: 0.01
|
m_Drag: 0.01
|
||||||
m_AngularDrag: 0.05
|
m_AngularDrag: 0.05
|
||||||
m_UseGravity: 1
|
m_UseGravity: 1
|
||||||
m_IsKinematic: 0
|
m_IsKinematic: 0
|
||||||
m_Interpolate: 0
|
m_Interpolate: 0
|
||||||
m_Constraints: 56
|
m_Constraints: 88
|
||||||
m_CollisionDetection: 0
|
m_CollisionDetection: 0
|
||||||
--- !u!114 &1211811542
|
--- !u!114 &1211811542
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@ -2083,10 +2001,160 @@ MonoBehaviour:
|
|||||||
grappleDrawingSpeed: 20
|
grappleDrawingSpeed: 20
|
||||||
grappleableLayer:
|
grappleableLayer:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 64
|
m_Bits: 72
|
||||||
|
aimSpeed: 40
|
||||||
gunPos: {fileID: 2098497450}
|
gunPos: {fileID: 2098497450}
|
||||||
canvasRect: {fileID: 3217252}
|
canvasRect: {fileID: 3217252}
|
||||||
hitMarkerRect: {fileID: 1301531513}
|
hitMarkerRect: {fileID: 1301531513}
|
||||||
|
--- !u!114 &1211811543
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1211811536}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Actions: {fileID: -944628639613478452, guid: 582d10d6a3775d649a7511ffad450745,
|
||||||
|
type: 3}
|
||||||
|
m_NotificationBehavior: 2
|
||||||
|
m_UIInputModule: {fileID: 0}
|
||||||
|
m_DeviceLostEvent:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_DeviceRegainedEvent:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_ControlsChangedEvent:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_ActionEvents:
|
||||||
|
- m_PersistentCalls:
|
||||||
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 1211811544}
|
||||||
|
m_TargetAssemblyTypeName: CharacterMovement, Assembly-CSharp
|
||||||
|
m_MethodName: Walk
|
||||||
|
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: a7460f10-3547-4a03-b2cf-17c79377189f
|
||||||
|
m_ActionName: Player/Walk[/Keyboard/a,/Keyboard/d]
|
||||||
|
- m_PersistentCalls:
|
||||||
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 1211811544}
|
||||||
|
m_TargetAssemblyTypeName: CharacterMovement, Assembly-CSharp
|
||||||
|
m_MethodName: Jump
|
||||||
|
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: e09d302b-d2bc-4e8e-a3a4-8cb74814c2cc
|
||||||
|
m_ActionName: Player/Jump[/Keyboard/space]
|
||||||
|
- m_PersistentCalls:
|
||||||
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 1211811542}
|
||||||
|
m_TargetAssemblyTypeName: GrappleHook, Assembly-CSharp
|
||||||
|
m_MethodName: Grapple
|
||||||
|
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: 7d1c4cb5-032a-4799-ac7b-841a778c389d
|
||||||
|
m_ActionName: Player/ShootGrapple[/Mouse/leftButton]
|
||||||
|
- m_PersistentCalls:
|
||||||
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 1211811542}
|
||||||
|
m_TargetAssemblyTypeName: GrappleHook, Assembly-CSharp
|
||||||
|
m_MethodName: AimInput
|
||||||
|
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: abdcd477-96c8-41e2-a4ff-70e14e18f036
|
||||||
|
m_ActionName: Player/Aim
|
||||||
|
- m_PersistentCalls:
|
||||||
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 1211811542}
|
||||||
|
m_TargetAssemblyTypeName: GrappleHook, Assembly-CSharp
|
||||||
|
m_MethodName: BoostToAnchor
|
||||||
|
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: dcc9ba8a-9503-43ef-a481-d6fc1abc5880
|
||||||
|
m_ActionName: Player/BoostToAnchor[/Mouse/rightButton]
|
||||||
|
- m_PersistentCalls:
|
||||||
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 1211811542}
|
||||||
|
m_TargetAssemblyTypeName: GrappleHook, Assembly-CSharp
|
||||||
|
m_MethodName: RaiseLowerGrapple
|
||||||
|
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: 098de720-4946-4b02-bafc-25d0f86614c6
|
||||||
|
m_ActionName: Player/RaiseLowerGrapple[/Keyboard/w,/Keyboard/s,/DualShock4GamepadHID/leftStick/up,/DualShock4GamepadHID/leftStick/down]
|
||||||
|
m_NeverAutoSwitchControlSchemes: 0
|
||||||
|
m_DefaultControlScheme:
|
||||||
|
m_DefaultActionMap: Player
|
||||||
|
m_SplitScreenIndex: -1
|
||||||
|
m_Camera: {fileID: 1530935837}
|
||||||
|
--- !u!114 &1211811544
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1211811536}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 60e46f6febb0d4a4592dd894365ffeb2, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
rb: {fileID: 1211811541}
|
||||||
|
canWalk: 1
|
||||||
|
canJump: 0
|
||||||
|
movementSpeed: 0.8
|
||||||
|
jumpPower: 5
|
||||||
|
groundDrag: 1
|
||||||
|
airDrag: 0
|
||||||
|
playerHeight: 0.5
|
||||||
|
isGrounded: 0
|
||||||
|
isJumping: 0
|
||||||
--- !u!1 &1301531512
|
--- !u!1 &1301531512
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -2241,8 +2309,8 @@ Transform:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1530935835}
|
m_GameObject: {fileID: 1530935835}
|
||||||
m_LocalRotation: {x: 0.000000001639493, y: 0.9994022, z: -0.03457181, w: 0.000000047394476}
|
m_LocalRotation: {x: 0.034571808, y: 0.0000000021495121, z: -7.4356965e-11, w: 0.9994022}
|
||||||
m_LocalPosition: {x: 4.54, y: 6.64, z: 22.81}
|
m_LocalPosition: {x: 4.54, y: 6.64, z: -22.81}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
@ -2328,7 +2396,7 @@ GameObject:
|
|||||||
- component: {fileID: 1547983499}
|
- component: {fileID: 1547983499}
|
||||||
- component: {fileID: 1547983498}
|
- component: {fileID: 1547983498}
|
||||||
- component: {fileID: 1547983497}
|
- component: {fileID: 1547983497}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor
|
m_Name: Floor
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -2425,7 +2493,7 @@ GameObject:
|
|||||||
- component: {fileID: 1678058225}
|
- component: {fileID: 1678058225}
|
||||||
- component: {fileID: 1678058224}
|
- component: {fileID: 1678058224}
|
||||||
- component: {fileID: 1678058223}
|
- component: {fileID: 1678058223}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_14
|
m_Name: Floor_14
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -2522,7 +2590,7 @@ GameObject:
|
|||||||
- component: {fileID: 1737815967}
|
- component: {fileID: 1737815967}
|
||||||
- component: {fileID: 1737815966}
|
- component: {fileID: 1737815966}
|
||||||
- component: {fileID: 1737815965}
|
- component: {fileID: 1737815965}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_01
|
m_Name: Floor_01
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -2619,7 +2687,7 @@ GameObject:
|
|||||||
- component: {fileID: 1815050702}
|
- component: {fileID: 1815050702}
|
||||||
- component: {fileID: 1815050701}
|
- component: {fileID: 1815050701}
|
||||||
- component: {fileID: 1815050700}
|
- component: {fileID: 1815050700}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_10
|
m_Name: Floor_10
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -2790,7 +2858,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_BindingMode: 0
|
m_BindingMode: 0
|
||||||
m_FollowOffset: {x: 0, y: 1.5799999, z: 22.81}
|
m_FollowOffset: {x: 0, y: 1.5799999, z: -22.81}
|
||||||
m_XDamping: 1
|
m_XDamping: 1
|
||||||
m_YDamping: 1
|
m_YDamping: 1
|
||||||
m_ZDamping: 1
|
m_ZDamping: 1
|
||||||
@ -2942,7 +3010,7 @@ GameObject:
|
|||||||
- component: {fileID: 2006523535}
|
- component: {fileID: 2006523535}
|
||||||
- component: {fileID: 2006523534}
|
- component: {fileID: 2006523534}
|
||||||
- component: {fileID: 2006523533}
|
- component: {fileID: 2006523533}
|
||||||
m_Layer: 6
|
m_Layer: 3
|
||||||
m_Name: Floor_12
|
m_Name: Floor_12
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
@ -3058,7 +3126,7 @@ Transform:
|
|||||||
m_ConstrainProportionsScale: 1
|
m_ConstrainProportionsScale: 1
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1211811540}
|
m_Father: {fileID: 1211811540}
|
||||||
m_RootOrder: 2
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
|
||||||
--- !u!23 &2098497452
|
--- !u!23 &2098497452
|
||||||
MeshRenderer:
|
MeshRenderer:
|
||||||
@ -3172,8 +3240,8 @@ Transform:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2129712287}
|
m_GameObject: {fileID: 2129712287}
|
||||||
m_LocalRotation: {x: 0.000000001639493, y: 0.9994022, z: -0.03457181, w: 0.000000047394476}
|
m_LocalRotation: {x: 0.034571808, y: 0.0000000021495121, z: -7.4356965e-11, w: 0.9994022}
|
||||||
m_LocalPosition: {x: 4.54, y: 6.64, z: 22.81}
|
m_LocalPosition: {x: 4.54, y: 6.64, z: -22.81}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5d423bbacc637604f93e3a3ea6a02a83
|
guid: 954d7774026fbc9469a7187b59cc1a67
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -67,7 +67,7 @@ public class CharacterMovement : MonoBehaviour
|
|||||||
if (canWalk)
|
if (canWalk)
|
||||||
{
|
{
|
||||||
Vector2 inputMovement = value.ReadValue<Vector2>();
|
Vector2 inputMovement = value.ReadValue<Vector2>();
|
||||||
rawInputMovement = new Vector3(-inputMovement.x, 0, inputMovement.y);
|
rawInputMovement = new Vector3(inputMovement.x, 0, inputMovement.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ using System.Collections;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
public class GrappleHook : MonoBehaviour
|
public class GrappleHook : MonoBehaviour
|
||||||
{
|
{
|
||||||
@ -21,6 +22,9 @@ public class GrappleHook : MonoBehaviour
|
|||||||
private float grappleDrawingSpeed = 20;
|
private float grappleDrawingSpeed = 20;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private LayerMask grappleableLayer;
|
private LayerMask grappleableLayer;
|
||||||
|
[SerializeField]
|
||||||
|
private float aimSpeed = 50f;
|
||||||
|
|
||||||
[Header("References")]
|
[Header("References")]
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private Transform gunPos;
|
private Transform gunPos;
|
||||||
@ -28,11 +32,15 @@ public class GrappleHook : MonoBehaviour
|
|||||||
private RectTransform canvasRect;
|
private RectTransform canvasRect;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private RectTransform hitMarkerRect;
|
private RectTransform hitMarkerRect;
|
||||||
private Vector3 hitPosLocal;
|
|
||||||
|
private PlayerInput playerInput;
|
||||||
|
|
||||||
|
private Vector3 hitPosLocal, aimDir, aimDirTarget;
|
||||||
private SpringJoint joint;
|
private SpringJoint joint;
|
||||||
private LineRenderer lr;
|
private LineRenderer lr;
|
||||||
RaycastHit hit;
|
RaycastHit hit;
|
||||||
private bool grappled = false, boosted = false;
|
private bool grappled = false, grappling = false, boosted = false, changingLength = false;
|
||||||
|
float changingLengthDir = 0;
|
||||||
private Vector3 currGrappleEndPos;
|
private Vector3 currGrappleEndPos;
|
||||||
|
|
||||||
|
|
||||||
@ -41,50 +49,39 @@ public class GrappleHook : MonoBehaviour
|
|||||||
lr = gameObject.GetComponentInChildren<LineRenderer>();
|
lr = gameObject.GetComponentInChildren<LineRenderer>();
|
||||||
lr.enabled = false;
|
lr.enabled = false;
|
||||||
hitMarkerRect.gameObject.SetActive(false);
|
hitMarkerRect.gameObject.SetActive(false);
|
||||||
|
playerInput = gameObject.GetComponent<PlayerInput>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(Input.GetMouseButtonUp(0)){//TODO Change to correct input system
|
|
||||||
EndGrapple();
|
|
||||||
}
|
|
||||||
if(grappled){
|
if(grappled){
|
||||||
DrawRope(Time.deltaTime);
|
DrawRope(Time.deltaTime);
|
||||||
if(Input.GetMouseButtonDown(1)){
|
|
||||||
boosted = true;
|
|
||||||
}
|
|
||||||
if(boosted){
|
if(boosted){
|
||||||
joint.maxDistance -= grappleBoostSpeed * Time.deltaTime;
|
joint.maxDistance -= grappleBoostSpeed * Time.deltaTime;
|
||||||
}
|
}
|
||||||
// TODO extend and retract rope
|
if(changingLength){
|
||||||
if(Input.GetKey(KeyCode.W)){
|
ChangeGrappleLength(changingLengthDir * grappleExtensionSpeed * Time.deltaTime);
|
||||||
ChangeGrappleLength(-grappleExtensionSpeed * Time.deltaTime);
|
|
||||||
}else if(Input.GetKey(KeyCode.S)){
|
|
||||||
ChangeGrappleLength(grappleExtensionSpeed * Time.deltaTime);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Aim();
|
Aim();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Aim(){
|
private void Aim(){
|
||||||
Vector3 mousePos;
|
aimDir = Vector3.Lerp(aimDir, aimDirTarget, Time.deltaTime * aimSpeed);
|
||||||
mousePos = Input.mousePosition;
|
|
||||||
mousePos.z = Mathf.Abs(Camera.main.transform.position.z);
|
|
||||||
mousePos = Camera.main.ScreenToWorldPoint(mousePos);
|
|
||||||
Vector3 aimDir = (mousePos - gameObject.transform.position).normalized;
|
|
||||||
|
|
||||||
if(!hitMarkerRect.gameObject.activeSelf)hitMarkerRect.gameObject.SetActive(true);
|
if(!hitMarkerRect.gameObject.activeSelf)hitMarkerRect.gameObject.SetActive(true);
|
||||||
hitMarkerRect.anchoredPosition = WorldToUI(gameObject.transform.position + aimDir * maxGrappleDist);
|
hitMarkerRect.anchoredPosition = WorldToUI(gameObject.transform.position + aimDir * maxGrappleDist);
|
||||||
|
|
||||||
if(Physics.Raycast(gameObject.transform.position, aimDir, out hit, maxGrappleDist, grappleableLayer)){
|
if(Physics.Raycast(gameObject.transform.position, aimDir, out hit, maxGrappleDist, grappleableLayer)){
|
||||||
hitMarkerRect.anchoredPosition = WorldToUI(hit.point);
|
hitMarkerRect.anchoredPosition = WorldToUI(hit.point);
|
||||||
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.green;
|
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.green;
|
||||||
if(Input.GetMouseButtonDown(0)){
|
if(grappling){
|
||||||
StartGrapple(hit);
|
StartGrapple(hit);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
@ -110,6 +107,7 @@ public class GrappleHook : MonoBehaviour
|
|||||||
}
|
}
|
||||||
private void StartGrapple(RaycastHit hit){
|
private void StartGrapple(RaycastHit hit){
|
||||||
grappled = true;
|
grappled = true;
|
||||||
|
grappling = false;
|
||||||
|
|
||||||
//Display
|
//Display
|
||||||
hitMarkerRect.gameObject.SetActive(false);
|
hitMarkerRect.gameObject.SetActive(false);
|
||||||
@ -136,6 +134,7 @@ public class GrappleHook : MonoBehaviour
|
|||||||
|
|
||||||
private void EndGrapple(){
|
private void EndGrapple(){
|
||||||
grappled = false;
|
grappled = false;
|
||||||
|
grappling = false;
|
||||||
lr.enabled = false;
|
lr.enabled = false;
|
||||||
boosted = false;
|
boosted = false;
|
||||||
Destroy(joint);
|
Destroy(joint);
|
||||||
@ -148,8 +147,52 @@ public class GrappleHook : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ChangeGrappleLength(float value){
|
private void ChangeGrappleLength(float value){
|
||||||
if(joint != null)
|
if(joint != null){
|
||||||
joint.maxDistance += value;
|
joint.maxDistance += value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Grapple(InputAction.CallbackContext context){
|
||||||
|
if(grappling && grappled)return;
|
||||||
|
if(context.performed){
|
||||||
|
grappling = true;
|
||||||
|
}else if(context.canceled){
|
||||||
|
EndGrapple();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void BoostToAnchor(InputAction.CallbackContext context){
|
||||||
|
if(context.performed && grappled){
|
||||||
|
boosted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AimInput(InputAction.CallbackContext context){
|
||||||
|
Vector2 value = context.ReadValue<Vector2>();
|
||||||
|
|
||||||
|
if(playerInput.currentControlScheme.Equals("Controller")){
|
||||||
|
if(value.magnitude == 0)return;
|
||||||
|
aimDirTarget = new Vector3(value.x, value.y, 0).normalized;
|
||||||
|
}else if(playerInput.currentControlScheme.Equals("KbMouse")){
|
||||||
|
var screenToWoldPoint = Camera.main.ScreenToWorldPoint(new Vector3(value.x, value.y, Mathf.Abs(Camera.main.transform.position.z)));
|
||||||
|
var aimDirTemp = (new Vector3(screenToWoldPoint.x-transform.position.x, screenToWoldPoint.y-transform.position.y, 0)).normalized;
|
||||||
|
if(aimDirTemp.magnitude == 0)return;
|
||||||
|
aimDirTarget = aimDirTemp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RaiseLowerGrapple(InputAction.CallbackContext context){
|
||||||
|
if(context.started){
|
||||||
|
//IsMoving and value should be 1 or -1
|
||||||
|
changingLength = true;
|
||||||
|
changingLengthDir = -context.ReadValue<Vector2>().y;
|
||||||
|
}else if(context.canceled){
|
||||||
|
//is not moving and shoud be 0
|
||||||
|
changingLength = false;
|
||||||
|
changingLengthDir = context.ReadValue<Vector2>().y;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user