Search Results for

    Show / Hide Table of Contents

    Class AnimationPlayer

    This class manages the player's animations, including setting animation states, handling directional changes, and triggering specific animations like punching.

    Inheritance
    object
    AnimationPlayer
    Namespace: Player
    Assembly: cs.temp.dll.dll
    Syntax
    public class AnimationPlayer : MonoBehaviour

    Fields

    backwards

    Indicates whether the player is facing backwards.

    Declaration
    public bool backwards
    Field Value
    Type Description
    bool

    block

    Indicates whether the player is currently blocking.

    Declaration
    public bool block
    Field Value
    Type Description
    bool

    clip

    The animation clip to play when the script starts.

    Declaration
    public AnimationClip clip
    Field Value
    Type Description
    AnimationClip

    state

    The current animation state of the player.

    Declaration
    public AnimationPlayer.AnimationState state
    Field Value
    Type Description
    AnimationPlayer.AnimationState

    Methods

    Punch()

    Triggers the punch animation.

    Declaration
    public void Punch()

    SetState(AnimationState)

    Sets the player's animation state.

    Declaration
    public void SetState(AnimationPlayer.AnimationState state)
    Parameters
    Type Name Description
    AnimationPlayer.AnimationState state

    The new animation state to set.

    In This Article
    Back to top Example Unity documentation footer