/// <summary>This method will mark all tranisitions as Conflict = true if they match the transition type and target object of the specified transition.</summary>
        private void RemoveConflictsBefore(List <LeanState> states, LeanState currentState, int currentIndex)
        {
            var currentConflict = currentState.Conflict;

            if (currentConflict != LeanState.ConflictType.None)
            {
                var currentType   = currentState.GetType();
                var currentTarget = currentState.GetTarget();

                for (var i = 0; i < currentIndex; i++)
                {
                    var transition = states[i];

                    if (transition.Skip == false && transition.GetType() == currentType && transition.GetTarget() == currentTarget)
                    {
                        transition.Skip = true;

                        if (currentConflict == LeanState.ConflictType.Complete)
                        {
                            transition.Update(1.0f);
                        }
                    }
                }
            }
        }
        /// <summary>If you failed to submit a previous transition then this will throw an error, and then submit them.</summary>
        public static void RequireSubmitted()
        {
            if (currentQueue != null)
            {
                Debug.LogError("You forgot to submit the last transition! " + currentQueue.GetType() + " - " + currentQueue.GetTarget());

                Submit();
            }

            if (baseMethodStack.Count > 0)
            {
                Debug.LogError("Failed to submit all methods.");

                Submit();
            }
        }
        /// <summary>If a transition is being animated in the editor, then the target object may not update, so this method will automatically dirty it so that it will.</summary>
        private static void DirtyTarget(LeanState transition)
        {
            if (Application.isPlaying == false)
            {
                var targetField = transition.GetType().GetField("Target");

                if (targetField != null)
                {
                    var target = targetField.GetValue(transition) as Object;

                    if (target != null)
                    {
                        EditorUtility.SetDirty(target);
                    }
                }
            }
        }