Author Topic: object[] support missing in TNet 3.1.0  (Read 115 times)

raptorx81

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 12
    • View Profile
object[] support missing in TNet 3.1.0
« on: November 22, 2017, 11:14:41 PM »
Our project uses a lot of object[] arrays to hold a variety of different data. We just finished our upgrade from 3.0.9 to 3.1.0 and along the way we ran into a slight problem. The new "UnityTools.GetType" method doesn't detect object arrays like the old "UnityTools.FindType" method did in the previous version.

In our case we simply added :

  1. else if (name == "System.Object[]") type = typeof(object[]);

On line 256 in TNSerializer.cs

Aren, just wanted to give you a heads up for a future fix and in case anyone else runs into this problem.

Cheers!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,137
  • Toronto, Canada
    • View Profile
Re: object[] support missing in TNet 3.1.0
« Reply #1 on: November 23, 2017, 01:36:42 AM »
This... I'm not sure what you're doing there, but trying to serialize an array of objects doesn't seem like a good idea. Each object can be a different type, with its own serialization. It's asking for trouble.

You adding System.Object[] means something was saved as "System.Object[]" -- text form of it. I'm surprised that worked at all, to be honest.