Search Unity

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:
    12
    gadgetfan and Peter77 like this.
  3. gadgetfan

    gadgetfan

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

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    624
    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:
    31
    Can confirm this still occurs in 2019.3.0b12. :( please..
     
  7. LeonhardP

    LeonhardP

    Unity Technologies

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