DoUndo() public méthode

public DoUndo ( UnityEngine target, string undoOperation ) : void
target UnityEngine
undoOperation string
Résultat void
        public void AddTransition(AnimatorStateTransition transition)
        {
            undoHandler.DoUndo(this, "Transition added");

            AnimatorStateTransition[] transitionsVector = transitions;
            ArrayUtility.Add(ref transitionsVector, transition);
            transitions = transitionsVector;
        }
        public void AddCondition(AnimatorConditionMode mode, float threshold, string parameter)
        {
            undoHandler.DoUndo(this, "Condition added");

            AnimatorCondition[] conditionVector = conditions;
            AnimatorCondition   newCondition    = new AnimatorCondition();

            newCondition.mode      = mode;
            newCondition.parameter = parameter;
            newCondition.threshold = threshold;

            ArrayUtility.Add(ref conditionVector, newCondition);
            conditions = conditionVector;
        }
Exemple #3
0
        public void AddLayer(AnimatorControllerLayer layer)
        {
            undoHandler.DoUndo(this, "Layer added");

            AnimatorControllerLayer[] layerVector = layers;
            ArrayUtility.Add(ref layerVector, layer);
            layers = layerVector;
        }
        public void AddState(AnimatorState state, Vector3 position)
        {
            ChildAnimatorState[] childStates = states;
            if (System.Array.Exists(childStates, childState => childState.state == state))
            {
                Debug.LogWarning(System.String.Format("State '{0}' already exists in state machine '{1}', discarding new state.", state.name, name));
                return;
            }

            undoHandler.DoUndo(this, "State added");
            ChildAnimatorState newState = new ChildAnimatorState();

            newState.state    = state;
            newState.position = position;

            ArrayUtility.Add(ref childStates, newState);
            states = childStates;
        }