diff --git a/.gitignore b/.gitignore
index 4c99e16cf..48be41767 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,3 +62,4 @@ ehthumbs.db
Thumbs.db
+/Assets/Mirror/Plugins/Unity.Cecil.meta
diff --git a/Assets/Mirror/Components/NetworkAnimator.cs b/Assets/Mirror/Components/NetworkAnimator.cs
index 54e682385..d0672ebca 100644
--- a/Assets/Mirror/Components/NetworkAnimator.cs
+++ b/Assets/Mirror/Components/NetworkAnimator.cs
@@ -3,13 +3,22 @@
namespace Mirror
{
+ ///
+ /// A component to synchronize Mecanim animation states for networked objects.
+ /// The animation of game objects can be networked by this component. There are two models of authority for networked movement:
+ /// If the object has authority on the client, then it should animated locally on the owning client. The animation state information will be sent from the owning client to the server, then broadcast to all of the other clients. This is common for player objects.
+ /// If the object has authority on the server, then it should be animated on the server and state information will be sent to all clients. This is common for objects not related to a specific client, such as an enemy unit.
+ /// The NetworkAnimator synchronizes the animation parameters that are checked in the inspector view. It does not automatically sychronize triggers. The function SetTrigger can by used by an object with authority to fire an animation trigger on other clients.
+ ///
[DisallowMultipleComponent]
[AddComponentMenu("Network/NetworkAnimator")]
[RequireComponent(typeof(NetworkIdentity))]
[HelpURL("https://vis2k.github.io/Mirror/Components/NetworkAnimator")]
public class NetworkAnimator : NetworkBehaviour
{
- // configuration
+ ///
+ /// The animator component to synchronize.
+ ///
[FormerlySerializedAs("m_Animator")] public Animator animator;
// Note: not an object[] array because otherwise initialization is real annoying
int[] lastIntParameters;
@@ -305,11 +314,20 @@ public override void OnDeserialize(NetworkReader reader, bool initialState)
}
}
+ ///
+ /// Causes an animation trigger to be invoked for a networked object.
+ /// If local authority is set, and this is called from the client, then the trigger will be invoked on the server and all clients. If not, then this is called on the server, and the trigger will be called on all clients.
+ ///
+ /// Name of trigger.
public void SetTrigger(string triggerName)
{
SetTrigger(Animator.StringToHash(triggerName));
}
+ ///
+ /// Causes an animation trigger to be invoked for a networked object.
+ ///
+ /// Hash id of trigger (from the Animator).
public void SetTrigger(int hash)
{
if (hasAuthority && localPlayerAuthority)