public FromStateTransitionHandler TransitionFrom(int source) { TransitionInfo info = null; foreach (TransitionInfo ti in TransitionInfos.Values) { if (ti.SourceId == source) { info = ti; break; } } if (info != null) { FromStateTransitionHandler handler = new FromStateTransitionHandler(info.Layer, info.SourceId); int id = handler.GetHashCode(); if (!TransitionHandlers.ContainsKey(id)) { TransitionHandlers [id] = handler; } return((FromStateTransitionHandler)TransitionHandlers [id]); } else { Debug.LogWarning("There seem to be no transitions from state [" + source + "]. Maybe you need to update the corresonding AnimatorAccess component."); return(null); } }
public FromStateTransitionHandler TransitionFrom (int source) { TransitionInfo info = null; foreach (TransitionInfo ti in TransitionInfos.Values) { if (ti.SourceId == source) { info = ti; break; } } if (info != null) { FromStateTransitionHandler handler = new FromStateTransitionHandler (info.Layer, info.SourceId); int id = handler.GetHashCode (); if (!TransitionHandlers.ContainsKey (id)) { TransitionHandlers [id] = handler; } return (FromStateTransitionHandler)TransitionHandlers [id]; } else { Debug.LogWarning ("There seem to be no transitions from state [" + source + "]. Maybe you need to update the corresonding AnimatorAccess component."); return null; } }