该项目的目的是同时测试和演示来自 Unity DOTS 技术堆栈的多个新包。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

27 行
775 B

using System;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;
namespace NetcodeTests
{
[TestFixture]
public class ReaderWriterTests
{
[Test]
public void NetworkReadWrite_TestRandomValues()
{
var random = new System.Random(192831);
var buffer = new uint[1024 * 1024];
for (int i = 0; i < 100; ++i)
{
var schema = NetworkTestUtils.GenerateRandomSchema(64, random.Next());
var values = NetworkTestUtils.GenerateRandomValues(schema, random.Next());
NetworkTestUtils.WriteValues(values, buffer, schema);
NetworkTestUtils.ReadAndAssertValues(values, buffer, schema);
}
}
}
}