Empty polymorphic list within SerializedScriptableObject on Android/IL2CPP

Issue #555 new
Andreas Podgurski created an issue

We’re using a polymorphic list to do certain animation steps within our cockpit, like pushing up the RPM to simulate a launching motor. This is done in a polymorphic list:

public class CockpitAutomation : SerializedScriptableObject {
  public List<AutomationBase> AutomationEvents = new List<AutomationBase>();

The base class is simply an abstract declaration:

    public abstract class AutomationBase {
        public string Slot;

        public abstract void EnableAutomation(Cockpit cockpit);
        public abstract void DisableAutomation(Cockpit cockpit);
        public abstract bool UpdateAutomation(Cockpit cockpit, float time);

This works fine in the editor and using the mono compiler. This even worked using the old .NET framework on Android, using the IL2CPP and Unity 2017.4.26. Now, after upgrading the system to Unity 2018.4.2 and .NET framework 4.x, this stopped working on IL2CPP for Android. While we don’t encounter any problems in the editor or by building with mono, the list is empty on the device with IL2CPP. There are no serialization errors thrown in the log, neither in the editor, nor on the device.
Any ideas, what went wrong here? This seems to be an ugly bug with a very specific target platform, a quick help would be very appreciated.

Comments (4)

  1. David Rochin

    I’m also having this issue. Also happens with dictionaries. Everything works fine in the editor but the lists and dictionaries are empty when testing on Android and IOS

  2. Ansar KA

    I am also facing the same issue. I am even facing it with Unity 2018.4 with .Net 3.5. Any updates on this? I am using Odin version 2.1.4.

  3. Tor Esa Vestergaard

    This longstanding issue should be resolved as of Odin patch 2.1.6, along with issue #430. Can anyone confirm that this is the case?

  4. Log in to comment