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

后端 未结 3 1865
北海茫月
北海茫月 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:34

    The string to pass in Animator.StringToHash should include layer's name and state's name.

    So to correctly generate the hash it should be:

    int rollState = Animator.StringToHash("Base Layer.Roll");
    

提交回复
热议问题