//---------------------------------------------------- /// <summary> /// Thumb 更新 /// </summary> private void UpdateThumb() { if (scope == null || thumb == null) { return; } if (m_DisplayType == DisplayType.Stretch) { if (m_Value <= 0) { scope.SetActive(false); } else { scope.SetActive(true); scope.SetAnchorToStretch(); scope.SetAnchorMin(0, 0); scope.SetAnchorMax(m_Value, 1); thumb.SetAnchorToStretch(); thumb.SetMargin(0, 0, 0, 0); } } else if (m_DisplayType == DisplayType.Mask) { if (m_Value <= 0) { scope.SetActive(false); } else { scope.SetActive(true); scope.SetAnchorToStretch(); float d = scope._w * (1.0f - m_Value); scope.SetMargin(0, d, 0, 0); thumb.SetAnchorToStretch(); thumb.SetMargin(0, -d, 0, 0); } } }