-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
リサイクルされた EnumPickerCell が、別の Enum 型用に再利用されるときに、 Enum 選択肢が以前の型のものになってしまうバグを見つけました。
手元で以下のような変更を行ったところ、うまく動作するようになりました:
--- a/Assets/UnityDebugSheet/Runtime/Core/Scripts/DefaultImpl/Cells/EnumPickerCell.cs
+++ b/Assets/UnityDebugSheet/Runtime/Core/Scripts/DefaultImpl/Cells/EnumPickerCell.cs
@@ -29,6 +29,15 @@ public sealed class EnumPickerCell : Cell<EnumPickerCellModel>
protected override void SetModel(EnumPickerCellModel model)
{
+ if (_isInitialized && 0 < _values.Count)
+ {
+ if (_values[0].GetType() != model.ActiveValue.GetType())
+ {
+ _options.Clear();
+ _values.Clear();
+ _isInitialized = false;
+ }
+ }
if (!_isInitialized)
{
var enumType = model.ActiveValue.GetType();ryooo
Metadata
Metadata
Assignees
Labels
No labels