Exemple #1
0
    public void DataToBytes()
    {
        string path = Path.Combine(Application.dataPath, "Test.bytes");

        byte[] b = BytesMapper.ToBytes <Test>(new Test());
        File.WriteAllBytes(path, b);
    }
Exemple #2
0
    public void BytesToData()
    {
        string path = Path.Combine(Application.dataPath, "Test.bytes");

        byte[] b    = File.ReadAllBytes(path);
        Test   test = BytesMapper.ToObject <Test>(b);

        Debug.LogFormat("vec2{0} vec3 {1}", test.Vec2, test.Vec3);
    }