Back to animator in-depth series Total catalogue
Unity5 improved the state hash and split it into Fullpathhash and shortnamehash, so let's see what the difference is.
Test results:
Fullpathhash supports nested nesting and layers, shortnamehash directly does not support paths
This is the test state machine used, altogether three states
Test script:
Public classa1:monobehaviour{ PublicAnimator Animator; voidOngui () {Guilayout.box ("Layer1 Fullpathhash-"+ (animator. Getcurrentanimatorstateinfo (0). Fullpathhash = = Animator.stringtohash ("Layer1.idle"))); Guilayout.box ("Layer1 Idle2 Fullpathhash-"+ (animator. Getcurrentanimatorstateinfo (0). Fullpathhash = = Animator.stringtohash ("Layer1.Group.Idle"))); Guilayout.box ("Layer2 Fullpathhash-"+ (animator. Getcurrentanimatorstateinfo (1). Fullpathhash = = Animator.stringtohash ("Layer2.idle"))); Guilayout.box ("Layer1 Shortnamehash-"+ (animator. Getcurrentanimatorstateinfo (0). Shortnamehash = = Animator.stringtohash ("Idle"))); Guilayout.box ("Layer1 Idle2 Shortnamehash (1)-"+ (animator. Getcurrentanimatorstateinfo (0). Shortnamehash = = Animator.stringtohash ("Group.idle"))); Guilayout.box ("Layer1 Idle2 Shortnamehash (2)-"+ (animator. Getcurrentanimatorstateinfo (0). Shortnamehash = = Animator.stringtohash ("Idle"))); Guilayout.box ("Layer2 Shortnamehash-"+ (animator. Getcurrentanimatorstateinfo (1). Shortnamehash = = Animator.stringtohash ("Idle"))); }}
View Code
Test result 1 (Layer1.Group.Idle not jump):
Test Result 2 (Layer1.Group.Idle has been redirected):
Final conclusion:
Fullpathhash supports sub-states and tiers, Shortnamehash directly does not support paths
Unity-animator in-depth series---fullpathhash and Shortnamehash