Skip to content

Commit aaf8aaa

Browse files
Revert "Fix exception when adding a new Rule when no Rule is selected (#278)"
This reverts commit ae01f64.
1 parent ae01f64 commit aaf8aaa

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Editor/Tiles/RuleTile/RuleTileEditor.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,7 @@ private void OnAddElement(object obj)
274274
else
275275
{
276276
tile.m_TilingRules.Insert(list.index + 1, rule);
277-
if (list.IsSelected(list.index))
278-
list.index += 1;
277+
list.index += 1;
279278
}
280279
}
281280

@@ -288,13 +287,12 @@ private void OnDuplicateElement(object obj)
288287
var copyRule = tile.m_TilingRules[list.index];
289288
var rule = copyRule.Clone();
290289
tile.m_TilingRules.Insert(list.index + 1, rule);
291-
if (list.IsSelected(list.index))
292-
list.index += 1;
290+
list.index += 1;
293291
}
294292

295293
private void OnAddDropdownElement(Rect rect, ReorderableList list)
296294
{
297-
if (0 <= list.index && list.index < tile.m_TilingRules.Count && list.IsSelected(list.index))
295+
if (0 <= list.index && list.index < tile.m_TilingRules.Count)
298296
{
299297
GenericMenu menu = new GenericMenu();
300298
menu.AddItem(EditorGUIUtility.TrTextContent("Add"), false, OnAddElement, list);

0 commit comments

Comments
 (0)