Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Unity crash if [SerializeReference] is used

Discussion in '2019.3 Beta' started by gadgetfan, Oct 22, 2019.

  1. gadgetfan

    gadgetfan

    Joined:
    Oct 1, 2018
    Posts:
    10
    I made a report about crush (http://fogbugz.unity3d.com/default.asp?1193292), but, just in case, want to ask, if I use the new SerializeReference attribute correctly ?

    1. What happened
    Unity Crash after SerializableObject with [SerializeReference]

    2. How we can reproduce it using the example you attached
    Use this class and choose from menu Create -> Test

    using System;
    using System.Collections.Generic;
    using UnityEngine;

    namespace viewer.editor.info.ship
    {
    [CreateAssetMenu(fileName = "Test", menuName = "Test", order = 52)]
    public class InfosTest : ScriptableObject
    {
    [SerializeField] private List<InfoTest> infos = new List<InfoTest>();
    }

    [Serializable]
    public class InfoTest
    {
    [SerializeReference] private List<ITest> infos = new List<ITest>();
    }

    public interface ITest
    {
    }
    }

    Unity Version: 2019.3.0b7, Windows10
     
    Last edited by a moderator: Oct 23, 2019
  2. MartinBarrette

    MartinBarrette

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    26
    gadgetfan and Peter77 like this.
  3. gadgetfan

    gadgetfan

    Joined:
    Oct 1, 2018
    Posts:
    10
  4. LazloBonin

    LazloBonin

    Joined:
    Mar 6, 2015
    Posts:
    813
    Can confirm this still occurs in 2019.3.0b10. :(
     
    artemio_morales and ROBYER1 like this.
  5. gadgetfan

    gadgetfan

    Joined:
    Oct 1, 2018
    Posts:
    10
    I had to remove all [SerializeRefence] from my code for now :( . Very usefull annotation, but could be used after fix only.
     
    Last edited: Nov 11, 2019
  6. kyuskoj

    kyuskoj

    Joined:
    Aug 28, 2013
    Posts:
    56
    Can confirm this still occurs in 2019.3.0b12. :( please..
     
  7. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    The fix will be in the next release, .0f2.
     
    gadgetfan likes this.