From d5fe58601460c0dff173156a09cd518f67ef989d Mon Sep 17 00:00:00 2001 From: octo Date: Sat, 15 Feb 2025 18:02:07 +0000 Subject: [PATCH 1/4] Implement color pickers --- .../UI/Pages/Settings/KataColorPicker.cs | 27 ++++++++++++++ .../UI/Pages/Settings/KataColorPicker.cs.meta | 3 ++ .../UI/Pages/Settings/ShootableColorPicker.cs | 26 ++++++++++++++ .../Settings/ShootableColorPicker.cs.meta | 3 ++ .../UI/Pages/Settings/UIColorPicker.cs | 36 +++++++++++++++++++ .../UI/Pages/Settings/UIColorPicker.cs.meta | 3 ++ 6 files changed, 98 insertions(+) create mode 100644 Assets/AudioKata/Scripts/UI/Pages/Settings/KataColorPicker.cs create mode 100644 Assets/AudioKata/Scripts/UI/Pages/Settings/KataColorPicker.cs.meta create mode 100644 Assets/AudioKata/Scripts/UI/Pages/Settings/ShootableColorPicker.cs create mode 100644 Assets/AudioKata/Scripts/UI/Pages/Settings/ShootableColorPicker.cs.meta create mode 100644 Assets/AudioKata/Scripts/UI/Pages/Settings/UIColorPicker.cs create mode 100644 Assets/AudioKata/Scripts/UI/Pages/Settings/UIColorPicker.cs.meta diff --git a/Assets/AudioKata/Scripts/UI/Pages/Settings/KataColorPicker.cs b/Assets/AudioKata/Scripts/UI/Pages/Settings/KataColorPicker.cs new file mode 100644 index 00000000..eca209eb --- /dev/null +++ b/Assets/AudioKata/Scripts/UI/Pages/Settings/KataColorPicker.cs @@ -0,0 +1,27 @@ +using System; +using AudioKata.Settings; +using TMPro; +using UnityEngine; +using UnityEngine.UI; + +namespace AudioKata.UI.Pages.Settings +{ + public class KataColorPicker : MonoBehaviour + { + [SerializeField] UIColorPicker colorPicker; + [SerializeField] Image selectedColorImage; + [SerializeField] TMP_Text displayNameLabel; + public void Setup(string metaDisplayName, KataColor settingValue, Func colorChangedDelegate) + { + displayNameLabel.SetText(metaDisplayName); + selectedColorImage.color = settingValue; + colorPicker.OnColorPicked += (color) => + { + if (colorChangedDelegate(color)) + { + selectedColorImage.color = color; + } + }; + } + } +} \ No newline at end of file diff --git a/Assets/AudioKata/Scripts/UI/Pages/Settings/KataColorPicker.cs.meta b/Assets/AudioKata/Scripts/UI/Pages/Settings/KataColorPicker.cs.meta new file mode 100644 index 00000000..25882918 --- /dev/null +++ b/Assets/AudioKata/Scripts/UI/Pages/Settings/KataColorPicker.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e301af5a8d61498990f8de95e3ac575b +timeCreated: 1739637987 \ No newline at end of file diff --git a/Assets/AudioKata/Scripts/UI/Pages/Settings/ShootableColorPicker.cs b/Assets/AudioKata/Scripts/UI/Pages/Settings/ShootableColorPicker.cs new file mode 100644 index 00000000..028866e9 --- /dev/null +++ b/Assets/AudioKata/Scripts/UI/Pages/Settings/ShootableColorPicker.cs @@ -0,0 +1,26 @@ +using System; +using UnityEngine; + +namespace AudioKata.UI.Pages.Settings +{ + /// + /// A shootable color picker that allows selecting a color from a texture + /// + public class ShootableColorPicker : Shootable + { + [SerializeField] Texture2D hueTexture; + + public event Action OnColorShot = delegate { }; + public override void OnShot(KataGun gun, RaycastHit raycastHit) + { + base.OnShot(gun, raycastHit); + Vector2 textureCoord = raycastHit.textureCoord; + int x = Mathf.FloorToInt(textureCoord.x * hueTexture.width); + int y = Mathf.FloorToInt(textureCoord.y * hueTexture.height); + x = Mathf.Clamp(x, 0, hueTexture.width - 1); + y = Mathf.Clamp(y, 0, hueTexture.height - 1); + Color sampledColor = hueTexture.GetPixel(x, y); + OnColorShot?.Invoke(sampledColor); + } + } +} \ No newline at end of file diff --git a/Assets/AudioKata/Scripts/UI/Pages/Settings/ShootableColorPicker.cs.meta b/Assets/AudioKata/Scripts/UI/Pages/Settings/ShootableColorPicker.cs.meta new file mode 100644 index 00000000..e8236c15 --- /dev/null +++ b/Assets/AudioKata/Scripts/UI/Pages/Settings/ShootableColorPicker.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9b67b5c383234531a0280fc03540095d +timeCreated: 1739639729 \ No newline at end of file diff --git a/Assets/AudioKata/Scripts/UI/Pages/Settings/UIColorPicker.cs b/Assets/AudioKata/Scripts/UI/Pages/Settings/UIColorPicker.cs new file mode 100644 index 00000000..bb50e37c --- /dev/null +++ b/Assets/AudioKata/Scripts/UI/Pages/Settings/UIColorPicker.cs @@ -0,0 +1,36 @@ +using System; +using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.UI; + +namespace AudioKata.UI.Pages.Settings +{ + /// + /// Simple color picker that picks a color from a texture, similar to + /// + public class UIColorPicker : MonoBehaviour, IPointerDownHandler + { + [SerializeField] RawImage hueImage; + [SerializeField] Texture2D hueTexture; + + public event Action OnColorPicked = delegate { }; + + public void OnPointerDown(PointerEventData eventData) + { + RectTransform rectTransform = hueImage.GetComponent(); + if (RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, eventData.position, eventData.pressEventCamera, out Vector2 localPoint)) + { + Rect rect = rectTransform.rect; + float xNormalized = Mathf.InverseLerp(rect.xMin, rect.xMax, localPoint.x); + float yNormalized = Mathf.InverseLerp(rect.yMin, rect.yMax, localPoint.y); + int x = Mathf.FloorToInt(xNormalized * hueTexture.width); + int y = Mathf.FloorToInt(yNormalized * hueTexture.height); + x = Mathf.Clamp(x, 0, hueTexture.width - 1); + y = Mathf.Clamp(y, 0, hueTexture.height - 1); + + Color sampledColor = hueTexture.GetPixel(x, y); + OnColorPicked?.Invoke(sampledColor); + } + } + } +} \ No newline at end of file diff --git a/Assets/AudioKata/Scripts/UI/Pages/Settings/UIColorPicker.cs.meta b/Assets/AudioKata/Scripts/UI/Pages/Settings/UIColorPicker.cs.meta new file mode 100644 index 00000000..50c35cfa --- /dev/null +++ b/Assets/AudioKata/Scripts/UI/Pages/Settings/UIColorPicker.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 148a2f1730164db493d3c1b3c2a3f01c +timeCreated: 1739639729 \ No newline at end of file From 53bfd163247a1f390108807d83642247a93c14c4 Mon Sep 17 00:00:00 2001 From: octo Date: Sat, 15 Feb 2025 18:03:54 +0000 Subject: [PATCH 2/4] Add color picker to settings menu --- .../Pages/Settings/SettingColorPicker.prefab | 364 ++++++++++++++++++ .../Settings/SettingColorPicker.prefab.meta | 7 + .../Pages/Settings/Settings Menu.prefab | 5 +- .../Pages/Settings/SettingsCategory.prefab | 125 ++++++ .../Pages/Settings/SettingsControlsFactory.cs | 25 ++ .../Textures/Sprites/UI/kata_hue_gradient.png | Bin 0 -> 2642 bytes .../Sprites/UI/kata_hue_gradient.png.meta | 130 +++++++ 7 files changed, 655 insertions(+), 1 deletion(-) create mode 100644 Assets/AudioKata/Prefabs/Pages/Settings/SettingColorPicker.prefab create mode 100644 Assets/AudioKata/Prefabs/Pages/Settings/SettingColorPicker.prefab.meta create mode 100644 Assets/AudioKata/Textures/Sprites/UI/kata_hue_gradient.png create mode 100644 Assets/AudioKata/Textures/Sprites/UI/kata_hue_gradient.png.meta diff --git a/Assets/AudioKata/Prefabs/Pages/Settings/SettingColorPicker.prefab b/Assets/AudioKata/Prefabs/Pages/Settings/SettingColorPicker.prefab new file mode 100644 index 00000000..8171f145 --- /dev/null +++ b/Assets/AudioKata/Prefabs/Pages/Settings/SettingColorPicker.prefab @@ -0,0 +1,364 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3256957734412286033 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8329072073024516413} + - component: {fileID: 8649361243547566873} + - component: {fileID: 4795036804523424932} + - component: {fileID: 4007703050341204625} + m_Layer: 5 + m_Name: ColorPicker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8329072073024516413 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3256957734412286033} + 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: 6748346447434165752} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 203.76999, y: 0} + m_SizeDelta: {x: 404.44, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8649361243547566873 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3256957734412286033} + m_CullTransparentMesh: 1 +--- !u!114 &4795036804523424932 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3256957734412286033} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + 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_Texture: {fileID: 2800000, guid: d6200033707e00b48954c55d4784e054, type: 3} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &4007703050341204625 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3256957734412286033} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 148a2f1730164db493d3c1b3c2a3f01c, type: 3} + m_Name: + m_EditorClassIdentifier: + hueImage: {fileID: 4795036804523424932} + hueTexture: {fileID: 2800000, guid: d6200033707e00b48954c55d4784e054, type: 3} +--- !u!1 &5058055937950736560 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6748346447434165752} + - component: {fileID: 4596775207724112533} + m_Layer: 5 + m_Name: SettingColorPicker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6748346447434165752 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5058055937950736560} + 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: 8125189699215648571} + - {fileID: 5357244903851936119} + - {fileID: 8329072073024516413} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &4596775207724112533 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5058055937950736560} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e301af5a8d61498990f8de95e3ac575b, type: 3} + m_Name: + m_EditorClassIdentifier: + colorPicker: {fileID: 4007703050341204625} + selectedColorImage: {fileID: 6030633045267444157} + displayNameLabel: {fileID: 3794331111414666930} +--- !u!1 &9202431194417966167 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5357244903851936119} + - component: {fileID: 9216722518556760306} + - component: {fileID: 6030633045267444157} + m_Layer: 5 + m_Name: SelectedColor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5357244903851936119 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9202431194417966167} + 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: 6748346447434165752} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -40, y: 0} + m_SizeDelta: {x: 50, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &9216722518556760306 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9202431194417966167} + m_CullTransparentMesh: 1 +--- !u!114 &6030633045267444157 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9202431194417966167} + 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: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 6842e05038768bc449fd0fbc194dfc76, 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!1001 &2959281589107803213 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 6748346447434165752} + m_Modifications: + - target: {fileID: 2141838651368821503, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: 'm_ActiveFontFeatures.Array.data[0]' + value: 1801810542 + objectReference: {fileID: 0} + - target: {fileID: 5147179209850649711, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_Name + value: SettingDisplayName Variant + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_RootOrder + value: -1 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_AnchorMin.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_SizeDelta.x + value: 300 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_SizeDelta.y + value: 50 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_AnchoredPosition.x + value: -250 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: a5cbf6748c79bff498db1be79416e8ed, type: 3} +--- !u!114 &3794331111414666930 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2141838651368821503, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + m_PrefabInstance: {fileID: 2959281589107803213} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!224 &8125189699215648571 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 6472519384575681398, guid: a5cbf6748c79bff498db1be79416e8ed, + type: 3} + m_PrefabInstance: {fileID: 2959281589107803213} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/AudioKata/Prefabs/Pages/Settings/SettingColorPicker.prefab.meta b/Assets/AudioKata/Prefabs/Pages/Settings/SettingColorPicker.prefab.meta new file mode 100644 index 00000000..8326f468 --- /dev/null +++ b/Assets/AudioKata/Prefabs/Pages/Settings/SettingColorPicker.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f377c03105e4cbd4eb0344fa908b0b17 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AudioKata/Prefabs/Pages/Settings/Settings Menu.prefab b/Assets/AudioKata/Prefabs/Pages/Settings/Settings Menu.prefab index 2d75467b..dc9cc92a 100644 --- a/Assets/AudioKata/Prefabs/Pages/Settings/Settings Menu.prefab +++ b/Assets/AudioKata/Prefabs/Pages/Settings/Settings Menu.prefab @@ -88,7 +88,10 @@ MonoBehaviour: sliderTemplate: {fileID: 5295334611921220266} sliderWithButtonTemplate: {fileID: 9137275556628441187} toggleTemplate: {fileID: 3164181234658569601} - calibrationPage: {fileID: 0} + colorPickerTemplate: {fileID: 4596775207724112533, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + calibrationPageVisual: {fileID: 0} + calibrationPageInput: {fileID: 0} --- !u!114 &6141493919961433805 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/AudioKata/Prefabs/Pages/Settings/SettingsCategory.prefab b/Assets/AudioKata/Prefabs/Pages/Settings/SettingsCategory.prefab index cd937a58..17f04c25 100644 --- a/Assets/AudioKata/Prefabs/Pages/Settings/SettingsCategory.prefab +++ b/Assets/AudioKata/Prefabs/Pages/Settings/SettingsCategory.prefab @@ -112,6 +112,7 @@ RectTransform: - {fileID: 8554897230442840146} - {fileID: 4687060596772002459} - {fileID: 3807853389008018828} + - {fileID: 4716051212628107225} m_Father: {fileID: 1822219801422699595} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -1799,6 +1800,130 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 1317731396093653094} m_PrefabAsset: {fileID: 0} +--- !u!1001 &2077345533427102241 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 5312966560048128036} + m_Modifications: + - target: {fileID: 5058055937950736560, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_Name + value: SettingColorPicker + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f377c03105e4cbd4eb0344fa908b0b17, type: 3} +--- !u!224 &4716051212628107225 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 6748346447434165752, guid: f377c03105e4cbd4eb0344fa908b0b17, + type: 3} + m_PrefabInstance: {fileID: 2077345533427102241} + m_PrefabAsset: {fileID: 0} --- !u!1001 &2887889320543469604 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/AudioKata/Scripts/UI/Pages/Settings/SettingsControlsFactory.cs b/Assets/AudioKata/Scripts/UI/Pages/Settings/SettingsControlsFactory.cs index 1c3f56cd..1c72f3e2 100644 --- a/Assets/AudioKata/Scripts/UI/Pages/Settings/SettingsControlsFactory.cs +++ b/Assets/AudioKata/Scripts/UI/Pages/Settings/SettingsControlsFactory.cs @@ -1,6 +1,7 @@ using System; using AudioKata.Settings; using UnityEngine; +using Object = UnityEngine.Object; namespace AudioKata.UI.Pages.Settings { @@ -11,6 +12,7 @@ public class SettingsControlsFactory : MonoBehaviour [SerializeField] private SettingsSliderUI sliderTemplate; [SerializeField] private SettingsSliderUI sliderWithButtonTemplate; [SerializeField] private SettingsToggleUI toggleTemplate; + [SerializeField] private KataColorPicker colorPickerTemplate; [SerializeField] private CalibrationMenuPage calibrationPageVisual; [SerializeField] private CalibrationMenuPage calibrationPageInput; @@ -45,6 +47,11 @@ public GameObject CreateControl(SettingsCategory categoryType, string key, Trans return CreateInputField(categoryType, key, parent, meta)?.gameObject; } + if (settingTypeName == nameof(KataColor)) + { + return CreateColorPicker(categoryType, key, parent, meta)?.gameObject; + } + if (settingTypeName is nameof(Single)) { if (meta.NumericRange == null) @@ -78,6 +85,24 @@ public GameObject CreateControl(SettingsCategory categoryType, string key, Trans return null; } + private KataColorPicker CreateColorPicker(SettingsCategory categoryType, string key, Transform parent, KataPrefMetaData meta) + { + var colorPicker = Instantiate( + colorPickerTemplate, + parent, + false + ); + + var settingValue = KataPreferences.Settings.Get(categoryType, key); + colorPicker.Setup( + meta.DisplayName, + settingValue, + newValue => KataPreferences.Settings.Set(categoryType, key, newValue) + ); + + return colorPicker; + } + /// /// Certain settings need specific controls instead of the standard ones. Handle those cases here. /// Returns true if the given setting was handled (with the created control passed back). diff --git a/Assets/AudioKata/Textures/Sprites/UI/kata_hue_gradient.png b/Assets/AudioKata/Textures/Sprites/UI/kata_hue_gradient.png new file mode 100644 index 0000000000000000000000000000000000000000..faa97f0157b7b1a70304b13bc389358819e603f9 GIT binary patch literal 2642 zcmeH}{a0Ft8ON{ba?-RKf9Tm(;|tr)nw_jmh+B*=h%7G)roKkAQsWD2Z8Q!6D?t)Z!UMqf3Y9(!*ibJ z^ZoHT-|so!zn2zM6W-eW761SVC-RS#0l>DGXB_b6tMx&s;=n87lu?hwIsWrI@k`j* zlwZLCfVbayHF1En_uZG;=80p6Pqp?2>|k?${?E3T?k~HDe;UK#-!8SMuy*dPXtw0S z6W^26cZxNOrD7!U2X!ii-JxM#k(+8OYe<6hNmJ-f%%e&XeC7T5KE})h zTqb8kHKP%vdS;THEfwI;&(`#yE!|ocy79<7v4TKSrocAazSh`>siT7f;fWZ0iX!Wj zXtr!jj2RqxDltCck`Bs(tAz!eRY{3Te#>RT{+uF@g8F+J8CpyF2g9(ybkNp*m=wlS zIoXyn@x$hmJ}iq`ZR2bGg8C)DLRm%f-JkY!+y6!=;h849aQb{1`(Cqnnsp)lV^8DV>{=QC~e}l!;!Gf!w1>!5~MmR=Q%Td|VA_le zGKF$M&A-|{QSAtIUE4);kGzqaV@+4-QyapU)2=}G)DqQ=fNig-6+B5VX(;an37Ee6 z#dxfolVkRqS}2b>XxTYada`QQh5T*6FRlZ?o9_X@k)6PW(%1O<8?Vjq|C$9^+yS0* z?56_?ACq(lyWQv4Gj*e`OJQO~+S*n?7OqBH~8dD~7Ozy((sh6J?s6KEAtvi(B-nI8XLJNOf1t$TeDhFUEd z_2N~8KTr@LaA}ZInWWO_!eZMfFTxQHE8I(?NXT&th4$GOtdo|x#f$>-g8MpixBEj2 z6ddHI)uy6+wU6QYPLSiRvctURFP30C)Wqm?49g|3m1zI;+er5G8Pm9{U-S~Av)L;kDm^2gdXeYe%U0wo$BPBWqqzra?D*7h-irsu|yPJ5mzRH zS00}yN=(UT3{9xib9l+ZTsGewN*c>evj+7wD2imfA+0^cr4)K*E-Ad$mT36e4(y;D z#$xHRwmGtrLQ!^zOc$P>Ps*+TBYp5YyYKD(-nOy9ts5aMqNL|75!SdxY6J`N9c%6L zQ=0|hFS2ewwr+@up9htF(i8twed(Hhewqzq?)}~NjpXQNtK(KRI*WL;B);z*8c`#PyAv_|sqF=N`;2=Xtg! z{hf@^9e8{6XW0%XaEPgtZEk2csvI1|IvdVCmN(^g@gEU}1g#S ztQ(S!q**eo9dj%Wz=vh#vaisU{(=XA4ml0^F5x6>1G;vYQ#8*Ec1jP-{I;s z9$N%oKtvIhfy2PszNcZn;jU!v@H;&kv=mZTP%?S{b~j)F+cUusL}1|G;tTu=&ZsY{ zQ&ON{4SoA8BB;il3H7*^z&gXSm2k0j-?EAT53GS#2gqJ)@;A6 Date: Sat, 15 Feb 2025 18:04:34 +0000 Subject: [PATCH 3/4] Update UI & gun colors whenever the color config changes --- Assets/AudioKata/Prefabs/DebugPlayer.prefab | 10 +++++++ Assets/AudioKata/Prefabs/XR Camera Rig.prefab | 10 +++++++ Assets/AudioKata/Scripts/KataGun.cs | 2 ++ .../Scripts/Settings/UserPreferences.cs | 8 +++--- .../Definitions/VisualConfig.cs | 26 +++++++++++++++++++ .../TargetPreview/Scripts/Targets/CueDart.cs | 1 + 6 files changed, 53 insertions(+), 4 deletions(-) diff --git a/Assets/AudioKata/Prefabs/DebugPlayer.prefab b/Assets/AudioKata/Prefabs/DebugPlayer.prefab index d5072dc0..c029f2df 100644 --- a/Assets/AudioKata/Prefabs/DebugPlayer.prefab +++ b/Assets/AudioKata/Prefabs/DebugPlayer.prefab @@ -526,6 +526,11 @@ PrefabInstance: propertyPath: handType value: 2 objectReference: {fileID: 0} + - target: {fileID: 1666709261117039964, guid: 2942a21401a861746b6c0d436c5815c1, + type: 3} + propertyPath: gunMaterial + value: + objectReference: {fileID: 2100000, guid: c2ab1f4105630ab4cb06edcff6e903cb, type: 2} - target: {fileID: 1666709261117039964, guid: 2942a21401a861746b6c0d436c5815c1, type: 3} propertyPath: gunTrailManager @@ -712,6 +717,11 @@ PrefabInstance: propertyPath: handType value: 1 objectReference: {fileID: 0} + - target: {fileID: 1666709261117039964, guid: 2942a21401a861746b6c0d436c5815c1, + type: 3} + propertyPath: gunMaterial + value: + objectReference: {fileID: 2100000, guid: 0b53c5d351c35704583bc86d74cf7471, type: 2} - target: {fileID: 1666709261117039964, guid: 2942a21401a861746b6c0d436c5815c1, type: 3} propertyPath: gunTrailManager diff --git a/Assets/AudioKata/Prefabs/XR Camera Rig.prefab b/Assets/AudioKata/Prefabs/XR Camera Rig.prefab index fc75d0db..d88d7bfd 100644 --- a/Assets/AudioKata/Prefabs/XR Camera Rig.prefab +++ b/Assets/AudioKata/Prefabs/XR Camera Rig.prefab @@ -1092,6 +1092,11 @@ PrefabInstance: propertyPath: handType value: 1 objectReference: {fileID: 0} + - target: {fileID: 1666709261117039964, guid: 2942a21401a861746b6c0d436c5815c1, + type: 3} + propertyPath: gunMaterial + value: + objectReference: {fileID: 2100000, guid: 0b53c5d351c35704583bc86d74cf7471, type: 2} - target: {fileID: 1666709261117039964, guid: 2942a21401a861746b6c0d436c5815c1, type: 3} propertyPath: gunTrailManager @@ -1265,6 +1270,11 @@ PrefabInstance: propertyPath: handType value: 2 objectReference: {fileID: 0} + - target: {fileID: 1666709261117039964, guid: 2942a21401a861746b6c0d436c5815c1, + type: 3} + propertyPath: gunMaterial + value: + objectReference: {fileID: 2100000, guid: c2ab1f4105630ab4cb06edcff6e903cb, type: 2} - target: {fileID: 1666709261117039964, guid: 2942a21401a861746b6c0d436c5815c1, type: 3} propertyPath: gunTrailManager diff --git a/Assets/AudioKata/Scripts/KataGun.cs b/Assets/AudioKata/Scripts/KataGun.cs index 4b524fbe..d9bd01e0 100644 --- a/Assets/AudioKata/Scripts/KataGun.cs +++ b/Assets/AudioKata/Scripts/KataGun.cs @@ -26,6 +26,7 @@ public class KataGun : MonoBehaviour, IRequireHandColors [SerializeField] Rigidbody gunBody; [SerializeField] Collider rigidBodyCollider; [SerializeField] bool temporalAimAssistEnabled; + [SerializeField] Material gunMaterial; public TargetHandType handType; public Transform gunTip; public Color gunColor; @@ -98,6 +99,7 @@ public void OnHandColorsChanged() { gunColor = VisualConfig.GetColorForHandType(handType); gunParticleController.UpdateColors(gunColor); + gunMaterial.color = gunColor; } public static bool TryGetGun(TargetHandType handType, out KataGun kataGun) => diff --git a/Assets/AudioKata/Scripts/Settings/UserPreferences.cs b/Assets/AudioKata/Scripts/Settings/UserPreferences.cs index 2cbf047f..c9ec70c4 100644 --- a/Assets/AudioKata/Scripts/Settings/UserPreferences.cs +++ b/Assets/AudioKata/Scripts/Settings/UserPreferences.cs @@ -137,12 +137,12 @@ private static (bool, string) ValidateSoundPackName(string soundPackName) new Color(1f, 0.3993749f, 0f, 1f), //Orange SettingsCategory.Customization, "leftHandColor", - onValueChanged: value => VisualConfig.Instance.leftHandColor = value, + onValueChanged: value => VisualConfig.SetHandColor(TargetHandType.Left, value), metaData: new KataPrefMetaData() { DisplayName = "Left Hand Color", Description = "Color of the left hand.", - SettingsDisplayType = SettingsDisplay.ReadOnly + SettingsDisplayType = SettingsDisplay.ReadWrite } ); @@ -150,12 +150,12 @@ private static (bool, string) ValidateSoundPackName(string soundPackName) new Color(0f, 0.6785717f, 1f, 1f), //Orange SettingsCategory.Customization, "rightHandColor", - onValueChanged: value => VisualConfig.Instance.rightHandColor = value, + onValueChanged: value => VisualConfig.SetHandColor(TargetHandType.Right, value), metaData: new KataPrefMetaData() { DisplayName = "Right Hand Color", Description = "Color of the right hand.", - SettingsDisplayType = SettingsDisplay.ReadOnly + SettingsDisplayType = SettingsDisplay.ReadWrite } ); diff --git a/Assets/AudioKata/TargetPreview/Assets/TargetPreview/ScriptableObjects/Definitions/VisualConfig.cs b/Assets/AudioKata/TargetPreview/Assets/TargetPreview/ScriptableObjects/Definitions/VisualConfig.cs index b5ba06da..eafa46aa 100644 --- a/Assets/AudioKata/TargetPreview/Assets/TargetPreview/ScriptableObjects/Definitions/VisualConfig.cs +++ b/Assets/AudioKata/TargetPreview/Assets/TargetPreview/ScriptableObjects/Definitions/VisualConfig.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using AudioKata.Scripts; +using AudioKata.Settings; using TargetPreview.Targets; using UnityEngine; @@ -102,5 +103,30 @@ public static void UnregisterForHandColorEvents(IRequireHandColors fHandColors) { handColorListeners.Remove(fHandColors); } + + public static void OnHandColorsUpdated() + { + foreach (var listener in handColorListeners) + { + listener.OnHandColorsChanged(); + } + } + + public static void SetHandColor(TargetHandType handType, KataColor value) + { + switch (handType) + { + case TargetHandType.Left: + Instance.leftHandColor = value; + break; + case TargetHandType.Right: + Instance.rightHandColor = value; + break; + case TargetHandType.None: + Instance.noHandColor = value; + break; + } + OnHandColorsUpdated(); + } } } diff --git a/Assets/AudioKata/TargetPreview/Assets/TargetPreview/Scripts/Targets/CueDart.cs b/Assets/AudioKata/TargetPreview/Assets/TargetPreview/Scripts/Targets/CueDart.cs index ec6ff0b4..9b5538d4 100644 --- a/Assets/AudioKata/TargetPreview/Assets/TargetPreview/Scripts/Targets/CueDart.cs +++ b/Assets/AudioKata/TargetPreview/Assets/TargetPreview/Scripts/Targets/CueDart.cs @@ -66,6 +66,7 @@ void OnDisable() public void OnTimeUpdated(float baseTimeMs, float audioTimeMs, float visualTimeMs, float inputTimeMs) { + startColor = VisualConfig.GetColorForHandType(handType); TargetReference? foundTarget = null; TargetReference? previousTarget = null; foreach (var cueManagerActiveCue in cueManager.ActiveCues) From 979efabdcccbca0e82752b00f7da49d65e3297be Mon Sep 17 00:00:00 2001 From: octo Date: Sat, 15 Feb 2025 18:18:45 +0000 Subject: [PATCH 4/4] Add localization strings for hand colors --- .../Localization/AKSettingsStrings Shared Data.asset | 8 ++++++++ .../Localization/AKSettingsStrings_en.asset | 8 ++++++++ .../Localization/AKSettingsStrings_fr.asset | 8 ++++++++ Assets/AudioKata/Scripts/Settings/UserPreferences.cs | 2 +- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings Shared Data.asset b/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings Shared Data.asset index e863c237..7d17c24b 100644 --- a/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings Shared Data.asset +++ b/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings Shared Data.asset @@ -119,6 +119,14 @@ MonoBehaviour: m_Key: setting_description_telegraphBoost m_Metadata: m_Items: [] + - m_Id: 2512391307780096 + m_Key: setting_description_rightHandColor + m_Metadata: + m_Items: [] + - m_Id: 2512450195808256 + m_Key: setting_description_leftHandColor + m_Metadata: + m_Items: [] m_Metadata: m_Items: [] m_KeyGenerator: diff --git a/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings_en.asset b/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings_en.asset index 39288089..8f855290 100644 --- a/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings_en.asset +++ b/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings_en.asset @@ -129,6 +129,14 @@ MonoBehaviour: m_Localized: Multiplies target colors to make them appear brighter. m_Metadata: m_Items: [] + - m_Id: 2512391307780096 + m_Localized: Right Hand Color + m_Metadata: + m_Items: [] + - m_Id: 2512450195808256 + m_Localized: Left Hand Color + m_Metadata: + m_Items: [] references: version: 2 RefIds: [] diff --git a/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings_fr.asset b/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings_fr.asset index 6d0e5662..66b60ad6 100644 --- a/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings_fr.asset +++ b/Assets/AudioKata/ScriptableObjects/Localization/AKSettingsStrings_fr.asset @@ -131,6 +131,14 @@ MonoBehaviour: m_Localized: Multiplie les couleurs cibles pour les rendre plus lumineuses. m_Metadata: m_Items: [] + - m_Id: 2512391307780096 + m_Localized: Couleur Main Gauche + m_Metadata: + m_Items: [] + - m_Id: 2512450195808256 + m_Localized: Couleur Main Droite + m_Metadata: + m_Items: [] references: version: 2 RefIds: [] diff --git a/Assets/AudioKata/Scripts/Settings/UserPreferences.cs b/Assets/AudioKata/Scripts/Settings/UserPreferences.cs index 21473dc7..4cf28419 100644 --- a/Assets/AudioKata/Scripts/Settings/UserPreferences.cs +++ b/Assets/AudioKata/Scripts/Settings/UserPreferences.cs @@ -3,6 +3,7 @@ using AudioKata.UI.Pages.SongSelect; using TargetPreview.ScriptableObjects; using TargetPreview.Scripts; +using TargetPreview.Targets; using UnityEngine; namespace AudioKata.Settings @@ -142,7 +143,6 @@ private static (bool, string) ValidateSoundPackName(string soundPackName) { DisplayName = "Left Hand Color", Description = "Color of the left hand.", - SettingsDisplayType = SettingsDisplay.Hide // Hiding until we can get a color picker added SettingsDisplayType = SettingsDisplay.ReadWrite } );