From 5b2b793b668500d38d6a25f14b5a534438b4536d Mon Sep 17 00:00:00 2001 From: minenice55 Date: Sun, 24 Dec 2023 23:12:25 -0500 Subject: [PATCH] controller title screen nav --- Assets/Scenes/Title.unity | 437 +++++++++++++++--- .../ControllerTypes/InputKeyboard.cs | 2 +- .../InputSystem/ControllerTypes/InputMouse.cs | 4 +- Assets/Scripts/InputSystem/InputController.cs | 14 +- Assets/Scripts/InputSystem/PlayerInput.cs | 6 - Assets/Scripts/TitleManager.cs | 267 ++++++++++- 6 files changed, 641 insertions(+), 89 deletions(-) diff --git a/Assets/Scenes/Title.unity b/Assets/Scenes/Title.unity index e1c671325..4946dfe6a 100644 --- a/Assets/Scenes/Title.unity +++ b/Assets/Scenes/Title.unity @@ -154,7 +154,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 551511482} - m_RootOrder: 15 + m_RootOrder: 16 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -482,7 +482,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 530.49994, y: -10.576233} + m_AnchoredPosition: {x: 551, y: -14.409576} m_SizeDelta: {x: 1149.1, y: 139.9575} m_Pivot: {x: 0.5, y: 1} --- !u!114 &75677143 @@ -704,11 +704,11 @@ RectTransform: m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 1592423196} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 50, y: 0} + m_AnchoredPosition: {x: 196, y: 0} m_SizeDelta: {x: 56, y: 56} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &124423117 @@ -1249,12 +1249,12 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 4 m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} + m_SelectOnUp: {fileID: 1336149019} + m_SelectOnDown: {fileID: 2079077664} + m_SelectOnLeft: {fileID: 2098364310} + m_SelectOnRight: {fileID: 1433046564} m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} @@ -1663,11 +1663,11 @@ RectTransform: m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 1923523151} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 50, y: 0} + m_AnchoredPosition: {x: 196, y: 0} m_SizeDelta: {x: 56, y: 56} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &462262275 @@ -1911,6 +1911,7 @@ RectTransform: - {fileID: 1399472975} - {fileID: 53800014} - {fileID: 39837708} + - {fileID: 1437246958} - {fileID: 1865546492} - {fileID: 921231848} - {fileID: 1482915177} @@ -2026,8 +2027,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 1191.7499, y: 0} - m_SizeDelta: {x: 794.49994, y: 445} + m_AnchoredPosition: {x: 1222.5, y: 0} + m_SizeDelta: {x: 815, y: 456.49997} m_Pivot: {x: 0.5, y: 1} --- !u!114 &594751226 MonoBehaviour: @@ -2300,7 +2301,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 530.49994, y: -171.68622} + m_AnchoredPosition: {x: 551, y: -183.18622} m_SizeDelta: {x: 1136, y: 372.6375} m_Pivot: {x: 0.5, y: 1} --- !u!114 &684958158 @@ -2465,7 +2466,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 348825b5c77b9d143961119fc008e631, type: 3} + m_Sprite: {fileID: 21300000, guid: 3d580e6535635714a9e8b5d2c426f6d6, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -2897,7 +2898,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1612412234317559814, guid: 0254202fd7d5ca84c8cf0950a645230b, type: 3} propertyPath: m_RootOrder - value: 8 + value: 9 objectReference: {fileID: 0} - target: {fileID: 1612412234317559814, guid: 0254202fd7d5ca84c8cf0950a645230b, type: 3} propertyPath: m_LocalScale.x @@ -3559,6 +3560,82 @@ Animator: m_AllowConstantClipSamplingOptimization: 1 m_KeepAnimatorStateOnDisable: 0 m_WriteDefaultValuesOnDisable: 0 +--- !u!1 &896543860 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 896543861} + - component: {fileID: 896543863} + - component: {fileID: 896543862} + m_Layer: 0 + m_Name: ButtonIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &896543861 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 896543860} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1437246958} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0.000030517578, y: 0} + m_SizeDelta: {x: 64, y: 64} + m_Pivot: {x: 0.5, y: 0} +--- !u!114 &896543862 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 896543860} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 0035f9ee73a3659488de4969ea48d035, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 8406874011085310447, guid: 149c162f840b9e9428b96653dd8e40ba, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &896543863 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 896543860} + m_CullTransparentMesh: 1 --- !u!1 &906174734 GameObject: m_ObjectHideFlags: 0 @@ -3686,7 +3763,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 0 m_WrapAround: 0 m_SelectOnUp: {fileID: 0} m_SelectOnDown: {fileID: 0} @@ -3893,7 +3970,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 551511482} - m_RootOrder: 16 + m_RootOrder: 17 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -4273,8 +4350,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 794.49994, y: -667.5} - m_SizeDelta: {x: 1588.9999, y: 445} + m_AnchoredPosition: {x: 815, y: -684.74994} + m_SizeDelta: {x: 1630, y: 456.49997} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1101280658 MonoBehaviour: @@ -4425,7 +4502,7 @@ RectTransform: m_Children: - {fileID: 526126132} m_Father: {fileID: 551511482} - m_RootOrder: 10 + m_RootOrder: 11 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 28.405} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -4531,6 +4608,82 @@ BoxCollider2D: m_CorrespondingSourceObject: {fileID: 6291913669464459655, guid: 0254202fd7d5ca84c8cf0950a645230b, type: 3} m_PrefabInstance: {fileID: 869323822} m_PrefabAsset: {fileID: 0} +--- !u!1 &1284552964 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1284552965} + - component: {fileID: 1284552967} + - component: {fileID: 1284552966} + m_Layer: 0 + m_Name: ButtonIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1284552965 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1284552964} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1592423196} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 16, y: 0} + m_SizeDelta: {x: 64, y: 64} + m_Pivot: {x: 0, y: 0.5} +--- !u!114 &1284552966 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1284552964} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 0035f9ee73a3659488de4969ea48d035, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 111238229322356548, guid: 149c162f840b9e9428b96653dd8e40ba, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1284552967 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1284552964} + m_CullTransparentMesh: 1 --- !u!1 &1284889615 GameObject: m_ObjectHideFlags: 0 @@ -4562,7 +4715,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 551511482} - m_RootOrder: 17 + m_RootOrder: 18 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0} m_AnchorMax: {x: 1, y: 0} @@ -4704,7 +4857,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 794.49994, y: 445} + m_SizeDelta: {x: 815, y: 456.49997} m_Pivot: {x: 0, y: 1} --- !u!114 &1285225122 MonoBehaviour: @@ -4744,6 +4897,82 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1285225120} m_CullTransparentMesh: 1 +--- !u!1 &1305960736 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1305960737} + - component: {fileID: 1305960739} + - component: {fileID: 1305960738} + m_Layer: 0 + m_Name: ButtonIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1305960737 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1305960736} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1923523151} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 16, y: 0} + m_SizeDelta: {x: 64, y: 64} + m_Pivot: {x: 0, y: 0.5} +--- !u!114 &1305960738 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1305960736} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 0035f9ee73a3659488de4969ea48d035, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 8406874011085310447, guid: 149c162f840b9e9428b96653dd8e40ba, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1305960739 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1305960736} + m_CullTransparentMesh: 1 --- !u!1 &1328299793 GameObject: m_ObjectHideFlags: 0 @@ -4775,7 +5004,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1923523151} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} @@ -4935,10 +5164,10 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 4 m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} + m_SelectOnUp: {fileID: 2079077664} + m_SelectOnDown: {fileID: 348029483} m_SelectOnLeft: {fileID: 0} m_SelectOnRight: {fileID: 0} m_Transition: 1 @@ -5190,8 +5419,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0, y: -445} - m_SizeDelta: {x: 794.49994, y: 445} + m_AnchoredPosition: {x: 0, y: -456.49997} + m_SizeDelta: {x: 815, y: 456.49997} m_Pivot: {x: 0, y: 0} --- !u!114 &1348032093 MonoBehaviour: @@ -5425,7 +5654,7 @@ RectTransform: m_Children: - {fileID: 637834698} m_Father: {fileID: 551511482} - m_RootOrder: 12 + m_RootOrder: 13 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 109.833} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -5607,12 +5836,12 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 4 m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} + m_SelectOnUp: {fileID: 1336149019} + m_SelectOnDown: {fileID: 2079077664} + m_SelectOnLeft: {fileID: 348029483} + m_SelectOnRight: {fileID: 2098364310} m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} @@ -5864,6 +6093,83 @@ Canvas: m_SortingLayerID: 805687615 m_SortingOrder: 1 m_TargetDisplay: 0 +--- !u!1 &1437246957 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1437246958} + - component: {fileID: 1437246960} + - component: {fileID: 1437246961} + m_Layer: 0 + m_Name: SelectableOver + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1437246958 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437246957} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 896543861} + m_Father: {fileID: 551511482} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 400, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1437246960 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437246957} + m_CullTransparentMesh: 1 +--- !u!114 &1437246961 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1437246957} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: f9232c079e126cd48a7344b23eaf42a5, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &1449891558 GameObject: m_ObjectHideFlags: 0 @@ -5901,8 +6207,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 794.49994, y: -222.5} - m_SizeDelta: {x: 1588.9999, y: 445} + m_AnchoredPosition: {x: 815, y: -228.25} + m_SizeDelta: {x: 1630, y: 456.49997} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1449891560 MonoBehaviour: @@ -5969,7 +6275,7 @@ RectTransform: m_Children: - {fileID: 422033008} m_Father: {fileID: 551511482} - m_RootOrder: 9 + m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: -25.01} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -6117,7 +6423,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 551511482} - m_RootOrder: 13 + m_RootOrder: 14 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -6228,14 +6534,15 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 1 m_Children: - - {fileID: 1880104640} - {fileID: 124423116} + - {fileID: 1880104640} + - {fileID: 1284552965} m_Father: {fileID: 429465179} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 272.00003, y: -64} + m_AnchoredPosition: {x: 272, y: -64} m_SizeDelta: {x: 256, y: 128} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1592423197 @@ -6251,7 +6558,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 0 m_WrapAround: 0 m_SelectOnUp: {fileID: 0} m_SelectOnDown: {fileID: 0} @@ -6609,8 +6916,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 1191.7499, y: -445} - m_SizeDelta: {x: 794.49994, y: 445} + m_AnchoredPosition: {x: 1222.5, y: -456.49997} + m_SizeDelta: {x: 815, y: 456.49997} m_Pivot: {x: 0.5, y: 0} --- !u!114 &1697728242 MonoBehaviour: @@ -6686,7 +6993,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 530.49994, y: -604.45} + m_AnchoredPosition: {x: 551, y: -623.6166} m_SizeDelta: {x: 1140.8, y: 77.9475} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1756042649 @@ -6971,6 +7278,15 @@ MonoBehaviour: chartTitleText: {fileID: 2077947577} chartMapperText: {fileID: 128923927} chartDescText: {fileID: 177207008} + mainSelectables: + - {fileID: 2079077664} + - {fileID: 1336149019} + - {fileID: 348029483} + - {fileID: 1433046564} + - {fileID: 2098364310} + defaultSelectable: {fileID: 2079077664} + selectedDisplayRect: {fileID: 1437246958} + selectedDisplayIcon: {fileID: 896543860} --- !u!82 &1811344143 AudioSource: m_ObjectHideFlags: 0 @@ -7119,7 +7435,7 @@ RectTransform: m_Children: - {fileID: 496851852} m_Father: {fileID: 551511482} - m_RootOrder: 7 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -7254,7 +7570,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1592423196} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} @@ -7391,7 +7707,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 551511482} - m_RootOrder: 14 + m_RootOrder: 15 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -7502,14 +7818,15 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 1 m_Children: - - {fileID: 1328299794} - {fileID: 462262274} + - {fileID: 1328299794} + - {fileID: 1305960737} m_Father: {fileID: 429465179} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 816.0001, y: -64} + m_AnchoredPosition: {x: 816, y: -64} m_SizeDelta: {x: 256, y: 128} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1923523152 @@ -7525,7 +7842,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 0 m_WrapAround: 0 m_SelectOnUp: {fileID: 0} m_SelectOnDown: {fileID: 0} @@ -8103,7 +8420,7 @@ RectTransform: m_Children: - {fileID: 1809456927} m_Father: {fileID: 551511482} - m_RootOrder: 11 + m_RootOrder: 12 m_LocalEulerAnglesHint: {x: 0, y: 0, z: -10.113} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -8469,10 +8786,10 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 4 m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} + m_SelectOnUp: {fileID: 348029483} + m_SelectOnDown: {fileID: 1336149019} m_SelectOnLeft: {fileID: 0} m_SelectOnRight: {fileID: 0} m_Transition: 1 @@ -8692,12 +9009,12 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 4 m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} + m_SelectOnUp: {fileID: 1336149019} + m_SelectOnDown: {fileID: 2079077664} + m_SelectOnLeft: {fileID: 1433046564} + m_SelectOnRight: {fileID: 348029483} m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Scripts/InputSystem/ControllerTypes/InputKeyboard.cs b/Assets/Scripts/InputSystem/ControllerTypes/InputKeyboard.cs index 6cab9c642..8ec72561a 100644 --- a/Assets/Scripts/InputSystem/ControllerTypes/InputKeyboard.cs +++ b/Assets/Scripts/InputSystem/ControllerTypes/InputKeyboard.cs @@ -151,7 +151,7 @@ namespace HeavenStudio.InputSystem public override int GetLastActionDown() { - for (int i = 0; i < BINDS_MAX; i++) + for (int i = 0; i < currentBindings.Pad.Length; i++) { if (Input.GetKeyDown((KeyCode)currentBindings.Pad[i])) return i; diff --git a/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs b/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs index df4e3bb24..e3813c5a7 100644 --- a/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs +++ b/Assets/Scripts/InputSystem/ControllerTypes/InputMouse.cs @@ -272,9 +272,9 @@ namespace HeavenStudio.InputSystem public override int GetLastActionDown() { - for (int i = 0; i < BINDS_MAX; i++) + for (int i = 0; i < currentBindings.Touch.Length; i++) { - if (Input.GetKeyDown((KeyCode)currentBindings.Pad[i])) + if (Input.GetKeyDown((KeyCode)currentBindings.Touch[i])) return i; } return -1; diff --git a/Assets/Scripts/InputSystem/InputController.cs b/Assets/Scripts/InputSystem/InputController.cs index a9ea3ebb3..00ecf70a2 100644 --- a/Assets/Scripts/InputSystem/InputController.cs +++ b/Assets/Scripts/InputSystem/InputController.cs @@ -107,14 +107,14 @@ namespace HeavenStudio.InputSystem //buttons used in Heaven Studio gameplay ("Form Baton" / WiiMote Style) public enum ActionsBaton : int { - South = 0, //-- all these... - East = 1, // | + North = 0, //-- all these... + South = 1, // | West = 2, // | - North = 3, //-- - Face = 4, // < ...are also equivalent to this, but with added directionality - Trigger = 5, // should never be used alone, but still bindable separately (controller logic should handle confirming & timestamping face + trigger input) - Up = 6, // Wiimote 1 - Down = 7, // Wiimote 2 + East = 3, //-- + Trigger = 4, // < ...are also equivalent to this, but with added directionality + Face = 5, + Down = 6, // Wiimote 1 + Up = 7, // Wiimote 2 Pause = 8, } diff --git a/Assets/Scripts/InputSystem/PlayerInput.cs b/Assets/Scripts/InputSystem/PlayerInput.cs index 6425b6cf7..9840b42d5 100644 --- a/Assets/Scripts/InputSystem/PlayerInput.cs +++ b/Assets/Scripts/InputSystem/PlayerInput.cs @@ -45,12 +45,6 @@ namespace HeavenStudio } } - //Clockwise - public const int UP = 0; - public const int RIGHT = 1; - public const int DOWN = 2; - public const int LEFT = 3; - public static InputController.ControlStyles CurrentControlStyle = InputController.ControlStyles.Pad; static List inputDevices; diff --git a/Assets/Scripts/TitleManager.cs b/Assets/Scripts/TitleManager.cs index 761230c37..e36a38baa 100644 --- a/Assets/Scripts/TitleManager.cs +++ b/Assets/Scripts/TitleManager.cs @@ -5,6 +5,7 @@ using UnityEngine.UI; using UnityEngine; using HeavenStudio.Util; using HeavenStudio.Common; +using HeavenStudio.InputSystem; using Starpelly; using System.Linq; @@ -45,6 +46,11 @@ namespace HeavenStudio [SerializeField] private TMP_Text chartMapperText; [SerializeField] private TMP_Text chartDescText; + [SerializeField] private Selectable[] mainSelectables; + [SerializeField] private Selectable defaultSelectable; + [SerializeField] private RectTransform selectedDisplayRect; + [SerializeField] private GameObject selectedDisplayIcon; + private AudioSource musicSource; private double songPosBeat; @@ -61,9 +67,12 @@ namespace HeavenStudio private bool logoRevealed; - private bool menuMode, snsRevealed, exiting; + private bool menuMode, snsRevealed, playMenuRevealed, exiting, firstPress, usingMouse; private Animator menuAnim; + private Selectable currentSelectable, mouseSelectable; + private RectTransform currentSelectableRect, lastSelectableRect; + private float selectableLerpTimer; private void Start() { @@ -74,6 +83,7 @@ namespace HeavenStudio startTime = Time.realtimeSinceStartupAsDouble; var _rand = new System.Random(); starAnims = starAnims.OrderBy(_ => _rand.Next()).ToList(); + selectedDisplayRect.gameObject.SetActive(false); #if UNITY_EDITOR versionText.text = "EDITOR"; @@ -101,14 +111,19 @@ namespace HeavenStudio songPosBeat = SecsToBeats(songPos); - var controllers = PlayerInput.GetInputControllers(); - foreach (var newController in controllers) + if (logoRevealed && !menuMode) { - if (newController.GetLastButtonDown(true) > 0) + var controllers = PlayerInput.GetInputControllers(); + foreach (var newController in controllers) { - if (logoRevealed && !menuMode) + if (newController.GetLastButtonDown(true) > 0) { menuMode = true; + firstPress = true; + currentSelectable = defaultSelectable; + SetSelectableRectTarget(currentSelectable); + selectableLerpTimer = 1; + menuAnim.Play("Revealed", 0, 0); pressAnyKeyAnim.Play("PressKeyFadeOut", 0, 0); SoundByte.PlayOneShot("ui/UIEnter"); @@ -120,16 +135,19 @@ namespace HeavenStudio { lastController.SetPlayer(null); newController.SetPlayer(1); + PlayerInput.CurrentControlStyle = newController.GetDefaultStyle(); + usingMouse = PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch; + selectedDisplayIcon.SetActive(!usingMouse); - if ((lastController as InputSystem.InputJoyshock) != null) + if ((lastController as InputJoyshock) != null) { - (lastController as InputSystem.InputJoyshock)?.UnAssignOtherHalf(); + (lastController as InputJoyshock)?.UnAssignOtherHalf(); } - if ((newController as InputSystem.InputJoyshock) != null) + if ((newController as InputJoyshock) != null) { newController.OnSelected(); - (newController as InputSystem.InputJoyshock)?.UnAssignOtherHalf(); + (newController as InputJoyshock)?.UnAssignOtherHalf(); } } } @@ -177,11 +195,232 @@ namespace HeavenStudio altBop = !altBop; } targetBopBeat += 1; - // if ((!settingsPanel.IsOpen) && logoRevealed && logoHoverCollider.OverlapPoint(Camera.main.ScreenToWorldPoint(Input.mousePosition))) - // { - // SoundByte.PlayOneShot("metronome"); - // } } + + if (menuMode && !(exiting || GlobalGameManager.IsShowingDialog)) + { + var controller = PlayerInput.GetInputController(1); + if (playMenuRevealed) + { + switch (controller.GetLastActionDown()) + { + case (int) InputController.ActionsPad.East: + PlayPanelAccept(); + break; + case (int) InputController.ActionsPad.South: + PlayPanelBack(); + break; + } + } + else if (snsRevealed) + { + if (controller.GetLastActionDown() == (int)InputController.ActionsPad.South) + { + SocialsClose(); + } + } + else + { + UpdateSelectable(controller); + } + } + } + + void UpdateSelectable(InputController controller) + { + selectableLerpTimer += Time.deltaTime; + if (selectableLerpTimer < 0.2f) + { + float prog = Mathf.Clamp01(selectableLerpTimer / 0.2f); + prog = 1f - Mathf.Pow(1f - prog, 3); + selectedDisplayRect.position = Vector3.Lerp(lastSelectableRect.position, currentSelectableRect.position, prog); + selectedDisplayRect.sizeDelta = Vector2.Lerp(lastSelectableRect.sizeDelta, currentSelectableRect.sizeDelta, prog); + } + else + { + selectedDisplayRect.position = currentSelectableRect.position; + selectedDisplayRect.sizeDelta = currentSelectableRect.sizeDelta; + } + + switch (PlayerInput.CurrentControlStyle) + { + case InputController.ControlStyles.Pad: + if (controller.GetActionUp(InputController.ControlStyles.Pad, (int)InputController.ActionsPad.East, out _)) + { + if (firstPress) + { + firstPress = false; + } + else if (currentSelectable != null && !usingMouse) + { + SoundByte.PlayOneShot("ui/UIPromptUp"); + currentSelectable.GetComponent