Unity3d - How to get Animator's Layer -->Sub-State --> State namehash?

后端 未结 3 1898
北海茫月
北海茫月 2021-01-22 14:08

I\'m using the following structure:

(Layer) \"Base Layer\" --> (Sub-State) \"Jump_Fall_Roll\" --> (State) \"Roll\"

static int rollState = Animat         


        
3条回答
  •  迷失自我
    2021-01-22 14:42

    I seriously have no Idea what changed in my project, but I tryed

    static int rollState = Animator.StringToHash ("Jump_Fall_Roll.Roll");
    

    again (I had tested it before I post this question and spend hours trying to resolve it) and it managed to work..........

    So, for Sub-States, do not include the Layer name in the hash, only the parent Sub-State of your State.

    I did not test for nested Sub-States.

    Thank you to those who tryed to help me

提交回复
热议问题