Skip to content

Commit fed45ab

Browse files
committed
- fix Bug when recycled EnumPickerCell is reused for another Enum type
1 parent b0860d9 commit fed45ab

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ public sealed class EnumPickerCell : Cell<EnumPickerCellModel>
2929

3030
protected override void SetModel(EnumPickerCellModel model)
3131
{
32+
if (_isInitialized && 0 < _values.Count)
33+
{
34+
if (_values[0].GetType() != model.ActiveValue.GetType())
35+
{
36+
_options.Clear();
37+
_values.Clear();
38+
_isInitialized = false;
39+
}
40+
}
3241
if (!_isInitialized)
3342
{
3443
var enumType = model.ActiveValue.GetType();

0 commit comments

Comments
 (0)