com.unity.netcode.gameobjects@1.0.0-pre.5

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Additional documentation and release notes are available at [Multiplayer Documentation](https://docs-multiplayer.unity3d.com).

## [1.0.0-pre.5] - 2022-01-26

### Added

- Added `PreviousValue` in `NetworkListEvent`, when `Value` has changed (#1528)

### Changed

- NetworkManager's GameObject is no longer allowed to be nested under one or more GameObject(s).(#1484)
- NetworkManager DontDestroy property was removed and now NetworkManager always is migrated into the DontDestroyOnLoad scene. (#1484)

### Fixed

- Fixed network tick value sometimes being duplicated or skipped. (#1614)
- Fixed The ClientNetworkTransform sample script to allow for owner changes at runtime. (#1606)
This commit is contained in:
Unity Technologies
2022-01-26 00:00:00 +00:00
parent 36d07fad5e
commit 4818405514
17 changed files with 403 additions and 39 deletions

View File

@@ -224,8 +224,8 @@ namespace Unity.Netcode.RuntimeTests
{
return m_Player1OnServer.TheList.Count == 1 &&
m_Player1OnClient1.TheList.Count == 1 &&
m_Player1OnServer.TheList.Contains(k_TestKey1) &&
m_Player1OnClient1.TheList.Contains(k_TestKey1);
m_Player1OnServer.TheList.Contains(k_TestVal1) &&
m_Player1OnClient1.TheList.Contains(k_TestVal1);
}
);
}
@@ -328,6 +328,58 @@ namespace Unity.Netcode.RuntimeTests
);
}
[UnityTest]
public IEnumerator NetworkListValueUpdate([Values(true, false)] bool useHost)
{
m_TestWithHost = useHost;
yield return MultiInstanceHelpers.RunAndWaitForCondition(
() =>
{
m_Player1OnServer.TheList.Add(k_TestVal1);
},
() =>
{
return m_Player1OnServer.TheList.Count == 1 &&
m_Player1OnClient1.TheList.Count == 1 &&
m_Player1OnServer.TheList[0] == k_TestVal1 &&
m_Player1OnClient1.TheList[0] == k_TestVal1;
}
);
var testSucceeded = false;
void TestValueUpdatedCallback(NetworkListEvent<int> changedEvent)
{
testSucceeded = changedEvent.PreviousValue == k_TestVal1 &&
changedEvent.Value == k_TestVal3;
}
try
{
yield return MultiInstanceHelpers.RunAndWaitForCondition(
() =>
{
m_Player1OnServer.TheList[0] = k_TestVal3;
m_Player1OnClient1.TheList.OnListChanged += TestValueUpdatedCallback;
},
() =>
{
return m_Player1OnServer.TheList.Count == 1 &&
m_Player1OnClient1.TheList.Count == 1 &&
m_Player1OnServer.TheList[0] == k_TestVal3 &&
m_Player1OnClient1.TheList[0] == k_TestVal3;
}
);
}
finally
{
m_Player1OnClient1.TheList.OnListChanged -= TestValueUpdatedCallback;
}
Assert.That(testSucceeded);
}
[Test]
public void NetworkListIEnumerator([Values(true, false)] bool useHost)
{