Search Unity

How was polymorphism serialized before advanced serializers were widely available?

Discussion in 'Scripting' started by AbandonedCrypt, Jan 25, 2021.

  1. AbandonedCrypt

    AbandonedCrypt

    Joined:
    Apr 13, 2019
    Posts:
    73
    I've been thinking about how I am going to serialize my inventory, which is basically one polymorphic array of base references. I debated to just go with OdinSerializer, but kept thinking about other way of doing it with the default tools at hand, such as a mediating class which sorts inventory-array items into arrays of their specific type to serialize those and resupply them to the main array at deserialization.

    However this got me curious about the methods that were the accepted go-to ones. Same for generics. Anyone got insights?
     
    kufra1 likes this.
  2. MartinBarrette

    MartinBarrette

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    26
    eses and Bunny83 like this.