性能优化与检测, 防止假死机
This commit is contained in:
@@ -77,11 +77,11 @@ namespace Demo.Game
|
||||
}
|
||||
protected override IEnumerator LoadFromImptCacheFile(ToolFile cacheFile)
|
||||
{
|
||||
using var stream = File.OpenWrite(cacheFile.GetFullPath());
|
||||
using var stream = File.OpenRead(cacheFile.GetFullPath());
|
||||
using var reader = new BinaryReader(stream);
|
||||
int length = reader.ReadInt32();
|
||||
Datas = new NativeArray<float>(length, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
|
||||
for (int i = 0; i < length; i++)
|
||||
Count = reader.ReadInt32();
|
||||
Datas = new NativeArray<float>(Count, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
|
||||
for (int i = 0; i < Count; i++)
|
||||
{
|
||||
Datas[i] = reader.ReadSingle();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user