commit
d47b99ce0c
|
@ -74,13 +74,15 @@ namespace UnityEngine.UI.Extensions
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private bool _displayPanelAbove = false;
|
private bool _displayPanelAbove = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
[Tooltip("Override the Text width for the values.")]
|
||||||
|
private bool _overrideTextWidth = true;
|
||||||
|
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class SelectionChangedEvent : UnityEngine.Events.UnityEvent<int> {
|
public class SelectionChangedEvent : UnityEngine.Events.UnityEvent<int> { }
|
||||||
}
|
|
||||||
// fires when item is changed;
|
// fires when item is changed;
|
||||||
public SelectionChangedEvent OnSelectionChanged;
|
public SelectionChangedEvent OnSelectionChanged;
|
||||||
|
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
Initialize();
|
Initialize();
|
||||||
|
@ -332,7 +334,10 @@ namespace UnityEngine.UI.Extensions
|
||||||
_hasDrawnOnce = true;
|
_hasDrawnOnce = true;
|
||||||
_mainButton.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, _rectTransform.sizeDelta.x);
|
_mainButton.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, _rectTransform.sizeDelta.x);
|
||||||
_mainButton.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, _rectTransform.sizeDelta.y);
|
_mainButton.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, _rectTransform.sizeDelta.y);
|
||||||
|
if (_overrideTextWidth)
|
||||||
|
{
|
||||||
_mainButton.txt.rectTransform.offsetMax = new Vector2(4, 0);
|
_mainButton.txt.rectTransform.offsetMax = new Vector2(4, 0);
|
||||||
|
}
|
||||||
|
|
||||||
_scrollPanelRT.SetParent(transform, true);//break the scroll panel from the overlay
|
_scrollPanelRT.SetParent(transform, true);//break the scroll panel from the overlay
|
||||||
_scrollPanelRT.anchoredPosition = _displayPanelAbove ?
|
_scrollPanelRT.anchoredPosition = _displayPanelAbove ?
|
||||||
|
|
|
@ -532,7 +532,6 @@ namespace UnityEngine.UI.Extensions
|
||||||
|
|
||||||
//HANDLE DRAG EVENTS
|
//HANDLE DRAG EVENTS
|
||||||
m_LowOffset = m_HighOffset = Vector2.zero;
|
m_LowOffset = m_HighOffset = Vector2.zero;
|
||||||
Vector2 localMousePos;
|
|
||||||
if(m_LowHandleRect != null && LowValue == MaxValue && RectTransformUtility.RectangleContainsScreenPoint(m_LowHandleRect, eventData.position, eventData.enterEventCamera))
|
if(m_LowHandleRect != null && LowValue == MaxValue && RectTransformUtility.RectangleContainsScreenPoint(m_LowHandleRect, eventData.position, eventData.enterEventCamera))
|
||||||
{
|
{
|
||||||
SetToMoveLowValueHandle(m_LowHandleRect, eventData);
|
SetToMoveLowValueHandle(m_LowHandleRect, eventData);
|
||||||
|
|
Loading…
Reference in New Issue