Skip to content

Commit e8d8525

Browse files
authored
chore: Update changelog for release 1.4.0 (#2487)
1 parent cfb3148 commit e8d8525

11 files changed

Lines changed: 450 additions & 175 deletions

File tree

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66

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

9-
## [Unreleased]
9+
## [1.4.0] - 2023-04-10
1010

1111
### Added
1212

@@ -41,6 +41,8 @@ Additional documentation and release notes are available at [Multiplayer Documen
4141

4242
### Fixed
4343

44+
- Fixed issue where `NetworkAnimator` was not properly detecting and synchronizing cross fade initiated transitions. (#2481)
45+
- Fixed issue where `NetworkAnimator` was not properly synchronizing animation state updates. (#2481)
4446
- Fixed an issue where Named Message Handlers could remove themselves causing an exception when the metrics tried to access the name of the message.(#2426)
4547
- Fixed registry of public `NetworkVariable`s in derived `NetworkBehaviour`s (#2423)
4648
- Fixed issue where runtime association of `Animator` properties to `AnimationCurve`s would cause `NetworkAnimator` to attempt to update those changes. (#2416)
@@ -51,7 +53,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
5153
- Fixed issue where a client would load duplicate scenes of already preloaded scenes during the initial client synchronization and `NetworkSceneManager.ClientSynchronizationMode` was set to `LoadSceneMode.Additive`. (#2383)
5254
- Fixed float NetworkVariables not being rendered properly in the inspector of NetworkObjects. (#2441)
5355

54-
## [1.3.0] - 2023-03-20
56+
## [1.3.1] - 2023-03-27
5557

5658
### Added
5759

com.unity.netcode.gameobjects/Components/NetworkAnimator.cs

Lines changed: 165 additions & 169 deletions
Large diffs are not rendered by default.

com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,10 @@ private void ConfigureSimulatorForUtp1()
14321432
private string m_ClientCaCertificate;
14331433

14341434
/// <summary>Set the server parameters for encryption.</summary>
1435+
/// <remarks>
1436+
/// The public certificate and private key are expected to be in the PEM format, including
1437+
/// the begin/end markers like <c>-----BEGIN CERTIFICATE-----</c>.
1438+
/// </remarks>
14351439
/// <param name="serverCertificate">Public certificate for the server (PEM format).</param>
14361440
/// <param name="serverPrivateKey">Private key for the server (PEM format).</param>
14371441
public void SetServerSecrets(string serverCertificate, string serverPrivateKey)
@@ -1442,9 +1446,15 @@ public void SetServerSecrets(string serverCertificate, string serverPrivateKey)
14421446

14431447
/// <summary>Set the client parameters for encryption.</summary>
14441448
/// <remarks>
1449+
/// <para>
14451450
/// If the CA certificate is not provided, validation will be done against the OS/browser
14461451
/// certificate store. This is what you'd want if using certificates from a known provider.
14471452
/// For self-signed certificates, the CA certificate needs to be provided.
1453+
/// </para>
1454+
/// <para>
1455+
/// The CA certificate (if provided) is expected to be in the PEM format, including the
1456+
/// begin/end markers like <c>-----BEGIN CERTIFICATE-----</c>.
1457+
/// </para>
14481458
/// </remarks>
14491459
/// <param name="serverCommonName">Common name of the server (typically hostname).</param>
14501460
/// <param name="caCertificate">CA certificate used to validate the server's authenticity.</param>

com.unity.netcode.gameobjects/TestHelpers/Runtime/IntegrationTestSceneHandler.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,11 @@ public void Dispose()
941941
}
942942
}
943943
QueuedSceneJobs.Clear();
944-
Object.Destroy(CoroutineRunner.gameObject);
944+
if (CoroutineRunner != null && CoroutineRunner.gameObject != null)
945+
{
946+
Object.Destroy(CoroutineRunner.gameObject);
947+
}
948+
945949
}
946950
}
947951
}

com.unity.netcode.gameobjects/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "com.unity.netcode.gameobjects",
33
"displayName": "Netcode for GameObjects",
44
"description": "Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.",
5-
"version": "1.3.0",
5+
"version": "1.4.0",
66
"unity": "2020.3",
77
"dependencies": {
88
"com.unity.nuget.mono-cecil": "1.10.1",

testproject/Assets/Tests/Manual/NetworkAnimatorTests/AnimatedCubeController.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,24 @@ private float GetLayerWeight(int layer)
189189
return m_Animator.GetLayerWeight(layer);
190190
}
191191

192+
[ServerRpc]
193+
private void TestCrossFadeServerRpc()
194+
{
195+
m_Animator.CrossFade("CrossFadeState", 0.25f, 0);
196+
}
197+
198+
private void TestCrossFade()
199+
{
200+
if (!IsServer && m_IsServerAuthoritative)
201+
{
202+
TestCrossFadeServerRpc();
203+
}
204+
else
205+
{
206+
m_Animator.CrossFade("CrossFadeState", 0.25f, 0);
207+
}
208+
}
209+
192210
private void LateUpdate()
193211
{
194212

@@ -209,6 +227,11 @@ private void LateUpdate()
209227

210228
DisplayTestIntValueIfChanged();
211229

230+
if (Input.GetKeyDown(KeyCode.G))
231+
{
232+
TestCrossFade();
233+
}
234+
212235
// Rotates the cube
213236
if (Input.GetKeyDown(KeyCode.C))
214237
{
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
using System.Collections.Generic;
2+
using Unity.Netcode;
3+
using UnityEngine;
4+
5+
/// <summary>
6+
/// This StateMachineBehaviour is used to detect an <see cref="Animator.CrossFade"/> initiated transition
7+
/// for integration test purposes.
8+
/// </summary>
9+
public class CrossFadeTransitionDetect : StateMachineBehaviour
10+
{
11+
public static Dictionary<ulong, Dictionary<int, AnimatorStateInfo>> StatesEntered = new Dictionary<ulong, Dictionary<int, AnimatorStateInfo>>();
12+
public static bool IsVerboseDebug;
13+
14+
public static string CurrentTargetStateName { get; private set; }
15+
public static int CurrentTargetStateHash { get; private set; }
16+
17+
public static List<ulong> ClientIds = new List<ulong>();
18+
19+
public static void ResetTest()
20+
{
21+
ClientIds.Clear();
22+
StatesEntered.Clear();
23+
IsVerboseDebug = false;
24+
}
25+
26+
private void Log(string logMessage)
27+
{
28+
if (!IsVerboseDebug)
29+
{
30+
return;
31+
}
32+
Debug.Log($"[CrossFadeDetect] {logMessage}");
33+
}
34+
35+
public static bool AllClientsTransitioned()
36+
{
37+
foreach (var clientId in ClientIds)
38+
{
39+
if (!StatesEntered.ContainsKey(clientId))
40+
{
41+
return false;
42+
}
43+
44+
if (!StatesEntered[clientId].ContainsKey(CurrentTargetStateHash))
45+
{
46+
return false;
47+
}
48+
}
49+
return true;
50+
}
51+
52+
public static void SetTargetAnimationState(string animationStateName)
53+
{
54+
CurrentTargetStateName = animationStateName;
55+
CurrentTargetStateHash = Animator.StringToHash(animationStateName);
56+
}
57+
58+
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
59+
{
60+
if (stateInfo.shortNameHash != CurrentTargetStateHash)
61+
{
62+
Log($"[Ignoring State][Layer-{layerIndex}] Incoming: ({stateInfo.fullPathHash}) | Targeting: ({CurrentTargetStateHash})");
63+
return;
64+
}
65+
66+
var networkObject = animator.GetComponent<NetworkObject>();
67+
if (networkObject == null || networkObject.NetworkManager == null || !networkObject.IsSpawned)
68+
{
69+
return;
70+
}
71+
72+
var clientId = networkObject.NetworkManager.LocalClientId;
73+
if (!StatesEntered.ContainsKey(clientId))
74+
{
75+
StatesEntered.Add(clientId, new Dictionary<int, AnimatorStateInfo>());
76+
}
77+
78+
if (!StatesEntered[clientId].ContainsKey(stateInfo.shortNameHash))
79+
{
80+
StatesEntered[clientId].Add(stateInfo.shortNameHash, stateInfo);
81+
}
82+
else
83+
{
84+
StatesEntered[clientId][stateInfo.shortNameHash] = stateInfo;
85+
}
86+
87+
Log($"[{layerIndex}][STATE-ENTER][{clientId}] {networkObject.NetworkManager.name} entered state {stateInfo.shortNameHash}!");
88+
}
89+
}

testproject/Assets/Tests/Manual/NetworkAnimatorTests/CrossFadeTransitionDetect.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

testproject/Assets/Tests/Manual/NetworkAnimatorTests/CubeAnimatorController.controller

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,34 @@ AnimatorState:
188188
m_MirrorParameter:
189189
m_CycleOffsetParameter:
190190
m_TimeParameter:
191+
--- !u!1102 &-7324519211837832008
192+
AnimatorState:
193+
serializedVersion: 6
194+
m_ObjectHideFlags: 1
195+
m_CorrespondingSourceObject: {fileID: 0}
196+
m_PrefabInstance: {fileID: 0}
197+
m_PrefabAsset: {fileID: 0}
198+
m_Name: CrossFadeState
199+
m_Speed: 1
200+
m_CycleOffset: 0
201+
m_Transitions:
202+
- {fileID: -5899436739107315318}
203+
m_StateMachineBehaviours:
204+
- {fileID: 8360333217518347423}
205+
m_Position: {x: 50, y: 50, z: 0}
206+
m_IKOnFeet: 0
207+
m_WriteDefaultValues: 1
208+
m_Mirror: 0
209+
m_SpeedParameterActive: 0
210+
m_MirrorParameterActive: 0
211+
m_CycleOffsetParameterActive: 0
212+
m_TimeParameterActive: 0
213+
m_Motion: {fileID: 7400000, guid: bd13c1363af7aaf4db0ffb085ac89d77, type: 2}
214+
m_Tag:
215+
m_SpeedParameter:
216+
m_MirrorParameter:
217+
m_CycleOffsetParameter:
218+
m_TimeParameter:
191219
--- !u!1101 &-6396453490711135124
192220
AnimatorStateTransition:
193221
m_ObjectHideFlags: 1
@@ -238,6 +266,28 @@ AnimatorStateTransition:
238266
m_InterruptionSource: 0
239267
m_OrderedInterruption: 1
240268
m_CanTransitionToSelf: 1
269+
--- !u!1101 &-5899436739107315318
270+
AnimatorStateTransition:
271+
m_ObjectHideFlags: 1
272+
m_CorrespondingSourceObject: {fileID: 0}
273+
m_PrefabInstance: {fileID: 0}
274+
m_PrefabAsset: {fileID: 0}
275+
m_Name:
276+
m_Conditions: []
277+
m_DstStateMachine: {fileID: 0}
278+
m_DstState: {fileID: -1676030328622575462}
279+
m_Solo: 0
280+
m_Mute: 0
281+
m_IsExit: 0
282+
serializedVersion: 3
283+
m_TransitionDuration: 0.25
284+
m_TransitionOffset: 0
285+
m_ExitTime: 0.75
286+
m_HasExitTime: 1
287+
m_HasFixedDuration: 1
288+
m_InterruptionSource: 0
289+
m_OrderedInterruption: 1
290+
m_CanTransitionToSelf: 1
241291
--- !u!1102 &-5552815716159021554
242292
AnimatorState:
243293
serializedVersion: 6
@@ -629,6 +679,9 @@ AnimatorStateMachine:
629679
- serializedVersion: 1
630680
m_State: {fileID: -1603678049383302394}
631681
m_Position: {x: 440, y: 190, z: 0}
682+
- serializedVersion: 1
683+
m_State: {fileID: -7324519211837832008}
684+
m_Position: {x: 570, y: -140, z: 0}
632685
m_ChildStateMachines: []
633686
m_AnyStateTransitions: []
634687
m_EntryTransitions: []
@@ -1266,3 +1319,15 @@ AnimatorStateMachine:
12661319
m_ExitPosition: {x: 800, y: 120, z: 0}
12671320
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
12681321
m_DefaultState: {fileID: 5205197960406981613}
1322+
--- !u!114 &8360333217518347423
1323+
MonoBehaviour:
1324+
m_ObjectHideFlags: 1
1325+
m_CorrespondingSourceObject: {fileID: 0}
1326+
m_PrefabInstance: {fileID: 0}
1327+
m_PrefabAsset: {fileID: 0}
1328+
m_GameObject: {fileID: 0}
1329+
m_Enabled: 1
1330+
m_EditorHideFlags: 0
1331+
m_Script: {fileID: 11500000, guid: 53314cafa8e073c40b0b35dd25485c42, type: 3}
1332+
m_Name:
1333+
m_EditorClassIdentifier:

testproject/Assets/Tests/Runtime/Animation/AnimatorTestHelper.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ public void SetTrigger(string name = "TestTrigger", bool monitorTrigger = false)
122122
}
123123
}
124124

125+
public const string TargetCrossFadeState = "CrossFadeState";
126+
127+
public void TestCrossFade()
128+
{
129+
m_Animator.CrossFade(TargetCrossFadeState, 0.25f, 0);
130+
}
131+
125132
public void SetBool(string name, bool valueToSet)
126133
{
127134
m_Animator.SetBool(name, valueToSet);

0 commit comments

Comments
 (0)