Mecanim Animation Editor-adding animation layers for parallel actions

Source: Internet
Author: User

1. Create a new state layer

A) create a new layer through the 1 button

b) The layer's weight is set by the 2 property, and if 0, the state of the layer does not affect the total state machine

c) Mask is the associated node of the Avatar that sets the animation , which can be edited after the Avatar mask is created

2, edit avatar Mask: Click can change the state, if the red node is not associated with the animation

3. Gets the Hash name of the state of the specified state layer:

int reloadhashname = Animator.stringtohash("Layer2.reload");

Gets the way: status layer name . Status Name

Function: Gets the name used to determine whether the state machine's current state is a specified state when the game is updated

4. Get status information of the state machine when the game is updated

Private Animatorstateinfo Layer2stateinfo;

Layer2stateinfo = Anima. Getcurrentanimatorstateinfo (1);

Gets state information for the specified state layer through the current animation controller ,

The Getcurrentanimatorstateinfo parameter is the index of the layer, starting from 0


5. Gets the state hash name of the current state machine

Layer2stateinfo.shortnamehash

6, Case: Do a character in the walk at the same time can take the gun action DEMO

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Mecanim Animation Editor-adding animation layers for parallel actions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.