diff --git a/Assets/Player/Input/PlayerInputs.inputactions b/Assets/Player/Input/PlayerInputs.inputactions index c40a9a0..6962ce8 100644 --- a/Assets/Player/Input/PlayerInputs.inputactions +++ b/Assets/Player/Input/PlayerInputs.inputactions @@ -49,6 +49,15 @@ "processors": "", "interactions": "", "initialStateCheck": false + }, + { + "name": "Cancel Lock-On", + "type": "Button", + "id": "f38f6ac6-41ce-416a-b47c-f948d0cde68a", + "expectedControlType": "", + "processors": "", + "interactions": "", + "initialStateCheck": false } ], "bindings": [ @@ -172,6 +181,61 @@ "action": "Lock-On", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "89e90b8f-c830-4d10-9046-c1db1ef970d0", + "path": "", + "interactions": "", + "processors": "", + "groups": "", + "action": "Cancel Lock-On", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "One Modifier", + "id": "cd93e290-6f16-49c1-af36-9d3eaedeb8a2", + "path": "OneModifier", + "interactions": "", + "processors": "", + "groups": "", + "action": "Cancel Lock-On", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "modifier", + "id": "8713a052-f2c4-439a-acae-f845a5654819", + "path": "", + "interactions": "", + "processors": "", + "groups": "", + "action": "Cancel Lock-On", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "binding", + "id": "013863ac-050d-4d7f-a36c-bce06827ad17", + "path": "", + "interactions": "", + "processors": "", + "groups": "", + "action": "Cancel Lock-On", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "84c3f849-8d7f-40ea-8c6c-4b5af0d9addd", + "path": "/rightStickPress", + "interactions": "Hold", + "processors": "", + "groups": ";Controller", + "action": "Cancel Lock-On", + "isComposite": false, + "isPartOfComposite": false } ] } diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 9049b29..a2b5a2f 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -2644,7 +2644,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 330585543} serializedVersion: 2 - m_LocalRotation: {x: 0.015995976, y: -0.067584075, z: 0.0010836906, w: 0.99758476} + m_LocalRotation: {x: 0.09176971, y: 0.050800513, z: -0.0046878606, w: 0.99447256} m_LocalPosition: {x: 1.5039132, y: 2.1421127, z: -6.8609486} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 @@ -2898,7 +2898,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 402424904} serializedVersion: 2 - m_LocalRotation: {x: 0.015995974, y: -0.06758407, z: 0.0010836904, w: 0.9975848} + m_LocalRotation: {x: 0.09176965, y: 0.050800513, z: -0.0046878555, w: 0.9944726} m_LocalPosition: {x: 1.5039132, y: 2.1421127, z: -6.8609486} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 @@ -2945,8 +2945,8 @@ MonoBehaviour: Wrap: 1 Recentering: Enabled: 0 - Wait: 1 - Time: 2 + Wait: 0 + Time: 0.3 Restrictions: 0 VerticalAxis: Value: 20 @@ -3398,9 +3398,6 @@ MonoBehaviour: - Object: {fileID: 1992890473} Weight: 1 Radius: 3.64 - - Object: {fileID: 1379573506} - Weight: 0.15 - Radius: 3.64 m_LegacyTargets: [] --- !u!4 &615613681 Transform: @@ -3411,7 +3408,7 @@ Transform: m_GameObject: {fileID: 615613679} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 1.5039132, y: -0.81913054, z: -1.296337} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -6759,8 +6756,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: lockOnDocument: {fileID: 1223043171} - lockOnTarget: {fileID: 1379573502} + lockOnTarget: {fileID: 0} targetGroup: {fileID: 615613680} + cmOrbitalFollow: {fileID: 0} lockOnRange: 40 lockOnTargets: [] --- !u!1 &2024357130 diff --git a/Assets/Scripts/Core/LockOnManager.cs b/Assets/Scripts/Core/LockOnManager.cs index 2efd4d0..6dfe1dd 100644 --- a/Assets/Scripts/Core/LockOnManager.cs +++ b/Assets/Scripts/Core/LockOnManager.cs @@ -14,6 +14,7 @@ public class LockOnManager : MonoBehaviour{ public UIDocument lockOnDocument; public GameObject lockOnTarget; public CinemachineTargetGroup targetGroup; + public CinemachineOrbitalFollow cmOrbitalFollow; public float lockOnRange; @@ -25,13 +26,12 @@ public class LockOnManager : MonoBehaviour{ // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { - if (lockOnTarget.GetComponent() == null) { + if (lockOnTarget && lockOnTarget.GetComponent() == null) { Debug.LogError($"Game Object {lockOnTarget.name} does not implement the ILockOnTarget interface. Not processing lock-on actions!"); } elementRoot = lockOnDocument.rootVisualElement.Query("LockOnGroup"); elementLabelName = lockOnDocument.rootVisualElement.Query