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
- Animator window has a dropdown button that throws “MissingReferenceException” error on a new project when the previous project had a GameObject with an animation
- Terrain Layer settings remain when the Terrain Layer is removed
- Terrain Layer settings UI elements overlap when a new Terrain Layer is created
- Animator State name overflows outside the visual box when the State has a long name
- UI Document file remains marked as Dirty after Undoing made changes
This is a duplicate of issue #1260516