Ejemplo n.º 1
0
        /// <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);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <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();
            }
        }