Ejemplo n.º 1
0
        public ToStateTransitionHandler TransitionTo(int destination)
        {
            TransitionInfo info = null;

            foreach (TransitionInfo ti in TransitionInfos.Values)
            {
                if (ti.DestId == destination)
                {
                    info = ti;
                    break;
                }
            }
            if (info != null)
            {
                ToStateTransitionHandler handler = new ToStateTransitionHandler(info.Layer, info.DestId);
                int id = handler.GetHashCode();
                if (!TransitionHandlers.ContainsKey(id))
                {
                    TransitionHandlers [id] = handler;
                }
                return((ToStateTransitionHandler)TransitionHandlers [id]);
            }
            else
            {
                Debug.LogWarning("There seem to be no transitions to state [" + destination + "]. Maybe you need to update the corresonding AnimatorAccess component.");
                return(null);
            }
        }
Ejemplo n.º 2
0
		public ToStateTransitionHandler TransitionTo (int destination) {
			TransitionInfo info = null;
			foreach (TransitionInfo ti in TransitionInfos.Values) {
				if (ti.DestId == destination) {
					info = ti;
					break;
				}
			}
			if (info != null) {
				ToStateTransitionHandler handler = new ToStateTransitionHandler (info.Layer, info.DestId);
				int id = handler.GetHashCode ();
				if (!TransitionHandlers.ContainsKey (id)) {
					TransitionHandlers [id] = handler;
				}
				return (ToStateTransitionHandler)TransitionHandlers [id];
			} else {
				Debug.LogWarning ("There seem to be no transitions to state [" + destination + "]. Maybe you need to update the corresonding AnimatorAccess component.");
				return null;
			}
		}