Closed liujunfan closed 3 months ago
啥信息都没提供光截个这图我咋知道你遇到啥问题。
Vector2Int 也截图啊
别用改造过的代码,用原代码先试试
Vector2也报错。试过了 Vector2Int 是unity自带的
int 没问题, unity 结构报错
别发截图了,请直接把代码粘过来
写个能复现的案例
using Vector3 = System.Numerics.Vector3;
[NinoSerialize]
public partial class TestB
{
public Dictionary<int, TestC> TestCs;
}
[NinoSerialize]
public partial class TestC
{
public Vector3 v2;
public Vector3[] v2s;
}
public class Test : MonoBehaviour
{
public void Awake()
{
TestB testB = new TestB();
testB.TestCs = new();
TestC c1 = new TestC();
c1.v2 = new Vector3( 10,0, 10);
c1.v2s = new []
{
new Vector3( 10,0, 10),
new Vector3( 11,0, 11)
};
testB.TestCs.Add(0, c1);
var bytes = Serializer.Serialize(testB);
TestB b = Deserializer.Deserialize<TestB>(bytes);
}
}
using Vector3 = System.Numerics.Vector3;
[NinoSerialize]
public partial class TestC
{
public Vector3[] v2s;
}
public class Test : MonoBehaviour
{
public void Awake()
{
TestC c1 = new TestC();
c1.v2s = new []
{
new Vector3( 10,0, 10),
new Vector3( 11,0, 11)
};
var bytes = Serializer.Serialize(c1);
TestC b = Deserializer.Deserialize<TestC>(bytes);
int n = 0;
}
}
已在v2.0.0修复
![Uploading [24KY~A47V_O6}X1()W`(]M.png…]()