- Home /
is it possible to read states / transitions from mecanim in runtime ?
minimum: i would like to know what state is mecanim on current gameobject, which transitions goes from the state and also states at the end of the transition
comfortable: same like 1 and i'd like to have access to all mecanim data in runtime
(i already know how to read stuff in editor http://answers.unity3d.com/questions/581125/is-it-possible-to-extend-mecanim.html , i am looking for the feature in runtime)
this is second time I am asking this question but with just simple answer refering to animator class etc. What I am looking for are few lines of code which will lguide me a bit, because I did not find it in the reference.
Edit: http://docs.unity3d.com/Documentation/ScriptReference/AnimatorStateInfo.html has no info about transitions and http://docs.unity3d.com/Documentation/ScriptReference/Animator.GetAnimatorTransitionInfo.html has probably info only about current (running) transition
if you can really help (cause i red the animator reference page few times and still don't get it) so please!
edit: can somebody please read this and tell me at least that it's not possible, so far i can read just the state i'm in and next state if i'm in transition, what i need is access to whole mecanim structure - so far i am generating text files by editor script, but it's very uncomfortable to work this way, cause you are never sure that gamedesigner pushed the right button after all changes
well you can't know all states of current controller, why do you need them ?
i want to read them on build, as i wrote in answer, i can do it in editor, but i'd like to access the animation tree in runtime ... are you sure it's not possible ?
Answer by komodor · Jan 22, 2014 at 07:58 PM
well looks like it's not possible in runtime, here's the link how to do it in editor:
http://answers.unity3d.com/questions/418854/getting-a-list-of-mecanim-states-in-animator.html