diff --git a/Assets/Resources/Prefabs/Common/RightClickDropdown.prefab b/Assets/Resources/Prefabs/Common/RightClickDropdown.prefab index fb6e594ce..b46f7f1a2 100644 --- a/Assets/Resources/Prefabs/Common/RightClickDropdown.prefab +++ b/Assets/Resources/Prefabs/Common/RightClickDropdown.prefab @@ -12,6 +12,7 @@ GameObject: - component: {fileID: 5892063193686803625} - component: {fileID: 2207471109642228847} - component: {fileID: 8328211396897494371} + - component: {fileID: 6891928905748349877} m_Layer: 5 m_Name: RightClickDropdown m_TagString: Untagged @@ -38,7 +39,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: -17.3663} - m_SizeDelta: {x: 160, y: 35} + m_SizeDelta: {x: 160, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5892063193686803625 CanvasRenderer: @@ -104,6 +105,20 @@ MonoBehaviour: m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 m_ReverseArrangement: 0 +--- !u!114 &6891928905748349877 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1069446853043438909} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 0 + m_VerticalFit: 2 --- !u!1 &5102644904920450891 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index 28e4c048b..5e6edd990 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -6615,6 +6615,7 @@ GameObject: m_Component: - component: {fileID: 279538358} - component: {fileID: 279538359} + - component: {fileID: 279538360} m_Layer: 5 m_Name: Toggle m_TagString: Untagged @@ -6691,6 +6692,25 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_IsOn: 1 +--- !u!114 &279538360 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 279538357} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e4972b7ea15fb7943ad12ed39e229140, type: 3} + m_Name: + m_EditorClassIdentifier: + _events: + - name: Reset + action: + m_PersistentCalls: + m_Calls: [] + _masterTrans: {fileID: 1791483803} + _dropDown: {fileID: 8384641343036272350, guid: 56a45ac5cd0da2a4ab398d1a63e18d9f, type: 3} --- !u!1 &282924607 GameObject: m_ObjectHideFlags: 0 @@ -21244,7 +21264,7 @@ MonoBehaviour: m_HandleRect: {fileID: 1589389271} m_Direction: 2 m_Value: 0 - m_Size: 1 + m_Size: 0.99999213 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -31067,6 +31087,7 @@ MonoBehaviour: inAuthorativeMenu: 0 isCursorEnabled: 1 isDiscordEnabled: 1 + ShouldQuit: 0 --- !u!114 &1423699438 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/UI/RightClickDropdownObject.cs b/Assets/Scripts/UI/RightClickDropdownObject.cs index 3750d2478..22745bb76 100644 --- a/Assets/Scripts/UI/RightClickDropdownObject.cs +++ b/Assets/Scripts/UI/RightClickDropdownObject.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.EventSystems; @@ -9,13 +10,52 @@ namespace HeavenStudio.Common { public class RightClickDropdownObject : MonoBehaviour, IPointerClickHandler { - [SerializeField] private Event[] events; + [SerializeField] private Event[] _events; + [Header("Components")] + [SerializeField] private Transform _masterTrans; + [SerializeField] private RectTransform _dropDown; + + private Button _dropDownButton; + + private RectTransform _currentDropDown; + + private void Awake() + { + _dropDownButton = _dropDown.GetChild(0).GetComponent