You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs
+41-3Lines changed: 41 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -200,6 +200,35 @@ internal class TransitionStateinfo
200
200
publicintTransitionIndex;
201
201
}
202
202
203
+
/// <summary>
204
+
/// Determines if the server or client owner pushes animation state updates.
205
+
/// </summary>
206
+
publicenumAuthorityModes
207
+
{
208
+
/// <summary>
209
+
/// Server pushes animator state updates.
210
+
/// </summary>
211
+
Server,
212
+
/// <summary>
213
+
/// Client owner pushes animator state updates.
214
+
/// </summary>
215
+
Owner,
216
+
}
217
+
218
+
219
+
/// <summary>
220
+
/// Determines whether this <see cref="NetworkAnimator"/> instance will have state updates pushed by the server or the client owner.
221
+
/// <see cref="AuthorityModes"/>
222
+
/// </summary>
223
+
#if MULTIPLAYER_SERVICES_SDK_INSTALLED
224
+
[Tooltip("Selects who has authority (sends state updates) over the <see cref="NetworkAnimator"/>instance.When the network topology isset to distributed authority,this always defaults to owner authority.If server (the default),then only server-side adjustments to the " +
225
+
"<see cref="NetworkAnimator"/> instance will be synchronized withclients.Ifowner(or client), then only the owner-side adjustments to the <see cref="NetworkAnimator"/>instance will be synchronized with both the server and other clients.")]
226
+
#else
227
+
[Tooltip("Selects who has authority (sends state updates) over the <see cref=\"NetworkAnimator\"/> instance. If server (the default), then only server-side adjustments to the <see cref=\"NetworkAnimator\"/> instance will be synchronized with clients. If owner (or client), "+
228
+
"then only the owner-side adjustments to the <see cref=\"NetworkAnimator\"/> instance will be synchronized with both the server and other clients.")]
229
+
#endif
230
+
public AuthorityModes AuthorityMode;
231
+
203
232
/// <summary>
204
233
/// Used to build the destination state to transition info table
205
234
/// </summary>
@@ -484,6 +513,9 @@ public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReade
484
513
485
514
[SerializeField]privateAnimatorm_Animator;
486
515
516
+
/// <summary>
517
+
/// The <see cref="Animator"/> associated with this <see cref="NetworkAnimator"/> instance.
518
+
/// </summary>
487
519
publicAnimatorAnimator
488
520
{
489
521
get{returnm_Animator;}
@@ -493,21 +525,27 @@ public Animator Animator
493
525
}
494
526
}
495
527
496
-
internalboolIsServerAuthoritative()
528
+
/// <summary>
529
+
/// Determines whether the <see cref="NetworkAnimator"/> is <see cref="AuthorityModes.Server"/> or <see cref="AuthorityModes.Owner"/> based on the <see cref="AuthorityMode"/> field.
530
+
/// Optionally, you can still derive from <see cref="NetworkAnimator"/> and override the <see cref="OnIsServerAuthoritative"/> method.
531
+
/// </summary>
532
+
/// <returns><see cref="true"/> or <see cref="false"/></returns>
533
+
publicboolIsServerAuthoritative()
497
534
{
498
535
returnOnIsServerAuthoritative();
499
536
}
500
537
501
538
/// <summary>
502
-
/// Override this method and return false to switch to owner authoritative mode.
539
+
/// Override this method and return false to switch to owner authoritative mode.<br />
540
+
/// Alternately, you can update the <see cref="AuthorityMode"/> field within the inspector view to select the authority mode.
503
541
/// </summary>
504
542
/// <remarks>
505
543
/// When using a distributed authority network topology, this will default to
0 commit comments