DTT更改
This commit is contained in:
@@ -2,7 +2,6 @@ using Convention;
|
||||
using Demo.Game.Attr;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Unity.Collections;
|
||||
using UnityEngine;
|
||||
@@ -20,11 +19,15 @@ namespace Demo.Game
|
||||
public override void Deserialize(BinaryReader reader)
|
||||
{
|
||||
BinarySerializeUtility.DeserializeNativeArray(reader, ref Datas);
|
||||
Count = Datas.Length;
|
||||
base.Deserialize(reader);
|
||||
}
|
||||
|
||||
public override void Serialize(BinaryWriter writer)
|
||||
{
|
||||
var newArray = new NativeArray<float>(Count, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
|
||||
NativeArray<float>.Copy(Datas, newArray, Count);
|
||||
Datas = newArray;
|
||||
BinarySerializeUtility.SerializeNativeArray(writer, Datas);
|
||||
base.Serialize(writer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user