Пример #1
0
        public override void ExecuteAction()
        {
#if UNITY_EDITOR
            Unsupported.CopyGameObjectsToPasteboard();
#endif
            Paste.SetBufferDistance(Selection.transforms);
        }
Пример #2
0
 private void CopySelection(GameObject[] selection)
 {
     if (selection != null && selection.Length > 0)
     {
         Selection.objects = selection;
         Unsupported.CopyGameObjectsToPasteboard();
     }
 }
        public static void Paste(GameObject[] targets)
        {
            Validate(targets);
            var previousSelection = Selection.objects;

            Selection.objects = targets;
            Unsupported.CopyGameObjectsToPasteboard();
            Selection.objects = previousSelection;
        }
Пример #4
0
        public override void ExecuteAction()
        {
            var selection = Selection.transforms;

            if (selection != null)
            {
                Unsupported.CopyGameObjectsToPasteboard();
                Paste.SetBufferDistance(Selection.transforms);

                foreach (var transform in selection)
                {
                    var go = transform.gameObject;
                    go.hideFlags = HideFlags.HideAndDontSave;
                    go.SetActive(false);
                }

                Selection.activeGameObject = null;
            }
        }
Пример #5
0
        // Copy
        protected override void CopyNodesToPasteboard()
        {
            // Do nothing if nothing is selected.
            if (selection.Count == 0)
            {
                return;
            }

            // Select the nodes in the scene hierarchy.
            Selection.objects = selection.Select(n => ((Node)n).runtimeInstance.gameObject).ToArray();

            // Copy them to the pasteboard.
            Unsupported.CopyGameObjectsToPasteboard();

            // Recover the selection.
            UpdateUnitySelection();

            // Reset the pasting offset counter.
            _pasteOffset = 1;
        }
Пример #6
0
        public override void ExecuteAction()
        {
            var selection = Selection.transforms;

            if (selection != null)
            {
#if UNITY_EDITOR
                Unsupported.CopyGameObjectsToPasteboard();
#endif
                Paste.SetBufferDistance(Selection.transforms);

                foreach (var transform in selection)
                {
                    var go = transform.gameObject;
                    go.hideFlags = HideFlags.HideInHierarchy | HideFlags.DontSaveInEditor;
                    go.SetActive(false);
                }

                Selection.activeGameObject = null;
            }
        }
Пример #7
0
 public override void ExecuteAction()
 {
     Unsupported.CopyGameObjectsToPasteboard();
     Paste.SetBufferDistance(Selection.transforms);
 }