Search Issue Tracker
Duplicate
Votes
0
Found in
2020.2.0a17
Issue ID
1265104
Regression
No
Crash in ApplyModifiedPropertiesWithoutUndo after reordering elements or duplicating an element in a list from the UI.
Repro steps:
- Open the repro project
- Open the SampleScene scene
- Select the "List" gameobject in the hierarchy (the list should be empty)
- Enter play mode, this will fill the list with random values
- Try to move the second element of the reorderable list in the first position.
- Observe a crash
Additionally the same crash happens if you try to duplicate one of the elements in the list.
Alternatively, you can copy/paste this script and try to reorder a component in the list in an already existing project:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using Random = System.Random;
using Object = UnityEngine.Object;
static class R { static Random r = new Random(); public static int integer => r.Next(); }
[Serializable]
class Test
{
public string name;
public string commonProperty1;
public Test()
{
name = "Test";
commonProperty1 = R.integer.ToString();
}
}
[Serializable]
class Test1 : Test
{
public string different1;
public Object sameName;
public Test1()
{
different1 = R.integer.ToString();
name = "Test 1";
}
}
[Serializable]
class Test2 : Test
{
public string different2;
public int sameName;
public Test2()
{
different2 = R.integer.ToString();
name = "Test 2";
sameName =R.integer;
}
}
class TestList : MonoBehaviour
{
[SerializeReference]
public List<Test> tests = new List<Test>();
void Start()
{
tests.Add(new Test2());
tests.Add(new Test1());
tests.Add(new Test2());
tests.Add(new Test1());
}
}
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- UI Toolkit 'background-size' property is not fully animatable
- Moving the Scrollbar via clicking no longer works after the first-click when page size is too small
- Elements in UI Builder Viewport are displayed incorrectly when Editor UI Scaling is set to 125%
- Prefab referencing a script is not shown in the Search window's Project tab when using "Find References In Project"
- Scroll view sensitivity remains unchanged when modifying the "--unity-metrics-single_line-height" value
This is a duplicate of issue #1260516