Search Results for

    Show / Hide Table of Contents

    Class NetworkAnimator

    A component to synchronize Mecanim animation states for networked objects.

    Inheritance
    Object
    NetworkBehaviour
    NetworkAnimator
    Inherited Members
    NetworkBehaviour.syncMode
    NetworkBehaviour.syncInterval
    NetworkBehaviour.isServer
    NetworkBehaviour.isClient
    NetworkBehaviour.isLocalPlayer
    NetworkBehaviour.isServerOnly
    NetworkBehaviour.isClientOnly
    NetworkBehaviour.hasAuthority
    NetworkBehaviour.netId
    NetworkBehaviour.connectionToServer
    NetworkBehaviour.connectionToClient
    NetworkBehaviour.syncObjects
    NetworkBehaviour.netIdentity
    NetworkBehaviour.ComponentIndex
    NetworkBehaviour.syncVarDirtyBits
    NetworkBehaviour.GetSyncVarHookGuard(UInt64)
    NetworkBehaviour.SetSyncVarHookGuard(UInt64, Boolean)
    NetworkBehaviour.SetSyncVarDirtyBit(UInt64)
    NetworkBehaviour.IsDirty()
    NetworkBehaviour.ClearAllDirtyBits()
    NetworkBehaviour.InitSyncObject(SyncObject)
    NetworkBehaviour.SendCommandInternal(String, NetworkWriter, Int32, Boolean)
    NetworkBehaviour.SendRPCInternal(String, NetworkWriter, Int32, Boolean)
    NetworkBehaviour.SendTargetRPCInternal(NetworkConnection, String, NetworkWriter, Int32)
    NetworkBehaviour.GeneratedSyncVarSetter<T>(T, T, UInt64, Action<T, T>)
    NetworkBehaviour.GeneratedSyncVarSetter_GameObject(GameObject, GameObject, UInt64, Action<GameObject, GameObject>, UInt32)
    NetworkBehaviour.GeneratedSyncVarSetter_NetworkIdentity(NetworkIdentity, NetworkIdentity, UInt64, Action<NetworkIdentity, NetworkIdentity>, UInt32)
    NetworkBehaviour.GeneratedSyncVarSetter_NetworkBehaviour<T>(T, T, UInt64, Action<T, T>, NetworkBehaviour.NetworkBehaviourSyncVar)
    NetworkBehaviour.SyncVarGameObjectEqual(GameObject, UInt32)
    NetworkBehaviour.SetSyncVarGameObject(GameObject, GameObject, UInt64, UInt32)
    NetworkBehaviour.GetSyncVarGameObject(UInt32, GameObject)
    NetworkBehaviour.SyncVarNetworkIdentityEqual(NetworkIdentity, UInt32)
    NetworkBehaviour.GeneratedSyncVarDeserialize<T>(T, Action<T, T>, T)
    NetworkBehaviour.GeneratedSyncVarDeserialize_GameObject(GameObject, Action<GameObject, GameObject>, NetworkReader, UInt32)
    NetworkBehaviour.GeneratedSyncVarDeserialize_NetworkIdentity(NetworkIdentity, Action<NetworkIdentity, NetworkIdentity>, NetworkReader, UInt32)
    NetworkBehaviour.GeneratedSyncVarDeserialize_NetworkBehaviour<T>(T, Action<T, T>, NetworkReader, NetworkBehaviour.NetworkBehaviourSyncVar)
    NetworkBehaviour.SetSyncVarNetworkIdentity(NetworkIdentity, NetworkIdentity, UInt64, UInt32)
    NetworkBehaviour.GetSyncVarNetworkIdentity(UInt32, NetworkIdentity)
    NetworkBehaviour.SyncVarNetworkBehaviourEqual<T>(T, NetworkBehaviour.NetworkBehaviourSyncVar)
    NetworkBehaviour.SetSyncVarNetworkBehaviour<T>(T, T, UInt64, NetworkBehaviour.NetworkBehaviourSyncVar)
    NetworkBehaviour.GetSyncVarNetworkBehaviour<T>(NetworkBehaviour.NetworkBehaviourSyncVar, T)
    NetworkBehaviour.SyncVarEqual<T>(T, T)
    NetworkBehaviour.SetSyncVar<T>(T, T, UInt64)
    NetworkBehaviour.SerializeSyncVars(NetworkWriter, Boolean)
    NetworkBehaviour.DeserializeSyncVars(NetworkReader, Boolean)
    NetworkBehaviour.SerializeObjectsAll(NetworkWriter)
    NetworkBehaviour.SerializeObjectsDelta(NetworkWriter)
    NetworkBehaviour.OnStartServer()
    NetworkBehaviour.OnStopServer()
    NetworkBehaviour.OnStartClient()
    NetworkBehaviour.OnStopClient()
    NetworkBehaviour.OnStartLocalPlayer()
    NetworkBehaviour.OnStopLocalPlayer()
    NetworkBehaviour.OnStartAuthority()
    NetworkBehaviour.OnStopAuthority()
    Namespace: Mirror
    Assembly: doc.dll
    Syntax
    public class NetworkAnimator : NetworkBehaviour
    Remarks

    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 be 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 all animation parameters of the selected Animator. It does not automatically synchronize triggers. The function SetTrigger can by used by an object with authority to fire an animation trigger on other clients.

    Fields

    | Improve this Doc View Source

    animator

    The animator component to synchronize.

    Declaration
    public Animator animator
    Field Value
    Type Description
    Animator
    | Improve this Doc View Source

    clientAuthority

    Declaration
    public bool clientAuthority
    Field Value
    Type Description
    Boolean

    Methods

    | Improve this Doc View Source

    OnDeserialize(NetworkReader, Boolean)

    Custom Deserialization

    Declaration
    public override void OnDeserialize(NetworkReader reader, bool initialState)
    Parameters
    Type Name Description
    NetworkReader reader
    Boolean initialState
    Overrides
    NetworkBehaviour.OnDeserialize(NetworkReader, Boolean)
    | Improve this Doc View Source

    OnSerialize(NetworkWriter, Boolean)

    Custom Serialization

    Declaration
    public override bool OnSerialize(NetworkWriter writer, bool initialState)
    Parameters
    Type Name Description
    NetworkWriter writer
    Boolean initialState
    Returns
    Type Description
    Boolean
    Overrides
    NetworkBehaviour.OnSerialize(NetworkWriter, Boolean)
    | Improve this Doc View Source

    ResetTrigger(Int32)

    Causes an animation trigger to be reset for a networked object.

    Declaration
    public void ResetTrigger(int hash)
    Parameters
    Type Name Description
    Int32 hash

    Hash id of trigger (from the Animator).

    | Improve this Doc View Source

    ResetTrigger(String)

    Causes an animation trigger to be reset for a networked object.

    If local authority is set, and this is called from the client, then the trigger will be reset on the server and all clients. If not, then this is called on the server, and the trigger will be reset on all clients.

    Declaration
    public void ResetTrigger(string triggerName)
    Parameters
    Type Name Description
    String triggerName

    Name of trigger.

    | Improve this Doc View Source

    SetTrigger(Int32)

    Causes an animation trigger to be invoked for a networked object.

    Declaration
    public void SetTrigger(int hash)
    Parameters
    Type Name Description
    Int32 hash

    Hash id of trigger (from the Animator).

    | Improve this Doc View Source

    SetTrigger(String)

    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.

    Declaration
    public void SetTrigger(string triggerName)
    Parameters
    Type Name Description
    String triggerName

    Name of trigger.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX