- changed status to open
Crash when removing/adding element in nested serialized list of prefab instance
Issue #8
resolved
Unity v5.5.0f3 is crashing when removing or adding an element in a nested list on a prefab instance.
Steps to Repro
Define the following classes:
public abstract class BaseEvent {}
public class MessageEvent : BaseEvent {
public string[] messages;
}
public class EventManager : SerializedMonoBehaviour {
[OdinSerialize]
private List<BaseEvent> events;
}
- Create an empty GameObject with an EventManager. Add a MessageEvent to the
events
list and a single string to themessages
array. - Save the GameObject as a prefab.
- Select the original GameObject instance (not the prefab).
- Delete the inner message (or click the plus to add a new element to the array).
- Observe crash.
- (Possibly relevant side effect:) Upon reopening Unity, the GameObject is no longer an instance of the prefab.
Comments (3)
-
-
- changed status to resolved
We've found the bug and fixed it in the next patch (0.9.0.2), which should hopefully be distributed sometime today.
Edit: Meanwhile, you can use a List<string> to contain your messages, as the error was related to prefab modifications that changed the length of an array.
-
- removed version
Removing version: 0.9.0.0 (automated comment)
- Log in to comment
Thank you for the report! We've reproduced this issue and are investigating it promptly.