Giter Site home page Giter Site logo

反序列化错误 about nino HOT 11 OPEN

liujunfan avatar liujunfan commented on June 9, 2024
反序列化错误

from nino.

Comments (11)

liujunfan avatar liujunfan commented on June 9, 2024

U(67% )P8CU@CTID5M8U5HG

from nino.

JasonXuDeveloper avatar JasonXuDeveloper commented on June 9, 2024

啥信息都没提供光截个这图我咋知道你遇到啥问题。

from nino.

liujunfan avatar liujunfan commented on June 9, 2024

24KY~A47V_O6}X1()W`( M

from nino.

JasonXuDeveloper avatar JasonXuDeveloper commented on June 9, 2024

Vector2Int 也截图啊

from nino.

JasonXuDeveloper avatar JasonXuDeveloper commented on June 9, 2024

别用改造过的代码,用原代码先试试

from nino.

liujunfan avatar liujunfan commented on June 9, 2024

Vector2也报错。试过了
Vector2Int 是unity自带的

from nino.

liujunfan avatar liujunfan commented on June 9, 2024

7GT}UR5OZLO({B03%BBJLDX
int 没问题, unity 结构报错

from nino.

JasonXuDeveloper avatar JasonXuDeveloper commented on June 9, 2024

别发截图了,请直接把代码粘过来

from nino.

JasonXuDeveloper avatar JasonXuDeveloper commented on June 9, 2024

写个能复现的案例

from nino.

liujunfan avatar liujunfan commented on June 9, 2024
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);
    }
}

from nino.

liujunfan avatar liujunfan commented on June 9, 2024
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;
    }
}

from nino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.