예제 #1
0
 public bool CopySelectionToPasteboard()
 {
     UnityEngine.Object[] array       = new UnityEngine.Object[0];
     Vector3[]            vectorArray = new Vector3[0];
     foreach (UnityEditor.Graphs.AnimationStateMachine.Node node in base.selection)
     {
         if (node is StateNode)
         {
             ArrayUtility.Add <UnityEngine.Object>(ref array, (node as StateNode).state);
             ArrayUtility.Add <Vector3>(ref vectorArray, new Vector3(node.position.x, node.position.y, 0f));
         }
         else if ((node is StateMachineNode) && ((node as StateMachineNode).stateMachine != AnimatorControllerTool.tool.stateMachineGraph.parentStateMachine))
         {
             ArrayUtility.Add <UnityEngine.Object>(ref array, (node as StateMachineNode).stateMachine);
             ArrayUtility.Add <Vector3>(ref vectorArray, new Vector3(node.position.x, node.position.y, 0f));
         }
     }
     foreach (int num in this.edgeGUI.edgeSelection)
     {
         EdgeInfo edgeInfo = this.stateMachineGraph.GetEdgeInfo(base.graph.edges[num]);
         foreach (TransitionEditionContext context in edgeInfo.transitions)
         {
             if (context.transition != null)
             {
                 ArrayUtility.Add <UnityEngine.Object>(ref array, context.transition);
                 ArrayUtility.Add <Vector3>(ref vectorArray, Vector3.zero);
             }
         }
     }
     Unsupported.CopyStateMachineDataToPasteboard(array, vectorArray, this.tool.animatorController, this.tool.selectedLayerIndex);
     return(array.Length > 0);
 }
예제 #2
0
 public bool CopySelectionToPasteboard()
 {
     UnityEngine.Object[] array         = new UnityEngine.Object[0];
     Vector3[]            monoPositions = new Vector3[0];
     using (List <UnityEditor.Graphs.Node> .Enumerator enumerator = this.selection.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             Node node = (Node)enumerator.Current;
             if (node is StateNode)
             {
                 ArrayUtility.Add <UnityEngine.Object>(ref array, (node as StateNode).state);
                 ArrayUtility.Add <Vector3>(ref monoPositions, new Vector3(node.position.x, node.position.y, 0f));
             }
             else if (node is StateMachineNode && (node as StateMachineNode).stateMachine != AnimatorControllerTool.tool.stateMachineGraph.parentStateMachine)
             {
                 ArrayUtility.Add <UnityEngine.Object>(ref array, (node as StateMachineNode).stateMachine);
                 ArrayUtility.Add <Vector3>(ref monoPositions, new Vector3(node.position.x, node.position.y, 0f));
             }
         }
     }
     foreach (int current in this.edgeGUI.edgeSelection)
     {
         EdgeInfo edgeInfo = this.stateMachineGraph.GetEdgeInfo(base.graph.edges[current]);
         foreach (TransitionEditionContext current2 in edgeInfo.transitions)
         {
             if (current2.transition != null)
             {
                 ArrayUtility.Add <UnityEngine.Object>(ref array, current2.transition);
                 ArrayUtility.Add <Vector3>(ref monoPositions, Vector3.zero);
             }
         }
     }
     Unsupported.CopyStateMachineDataToPasteboard(array, monoPositions, this.tool.animatorController, this.tool.selectedLayerIndex);
     return(array.Length > 0);
 }
예제 #3
0
 private void CopyStateMachineCallback(object data)
 {
     Unsupported.CopyStateMachineDataToPasteboard(this.activeStateMachine, AnimatorControllerTool.tool.animatorController, AnimatorControllerTool.tool.selectedLayerIndex);
 }