Skip to content

Commit dac2bbc

Browse files
authored
Merge pull request Haruma-K#24 from yakisabananoka/feature/fix_slider_cell_reuse_bug
SliderCellにおいて、セルが再利用された際に意図しない値が入力される問題
2 parents 010fd5d + ff1f037 commit dac2bbc

File tree

1 file changed

+2
-4
lines changed
  • Assets/UnityDebugSheet/Runtime/Core/Scripts/DefaultImpl/Cells

1 file changed

+2
-4
lines changed

Assets/UnityDebugSheet/Runtime/Core/Scripts/DefaultImpl/Cells/SliderCell.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ protected override void SetModel(SliderCellModel model)
2222
{
2323
_contentsCanvasGroup.alpha = model.Interactable ? 1.0f : 0.3f;
2424

25-
// Slider
26-
slider.minValue = model.MinValue;
27-
slider.maxValue = model.MaxValue;
28-
2925
// Icon
3026
icon.Setup(model.Icon);
3127
icon.gameObject.SetActive(model.Icon.Sprite != null);
@@ -56,6 +52,8 @@ protected override void SetModel(SliderCellModel model)
5652
// Slider
5753
slider.interactable = model.Interactable;
5854
slider.onValueChanged.RemoveAllListeners();
55+
slider.minValue = model.MinValue;
56+
slider.maxValue = model.MaxValue;
5957
slider.SetValueWithoutNotify(value);
6058
slider.wholeNumbers = model.WholeNumbers;
6159
slider.onValueChanged.AddListener(x =>

0 commit comments

Comments
 (0)