PasteGameObjectsFromPasteboard() private method

private PasteGameObjectsFromPasteboard ( ) : void
return void
Esempio n. 1
0
 internal static void PasteGO(Transform fallbackParent)
 {
     if (CutBoard.hasCutboardData)
     {
         CutBoard.PasteGameObjects(fallbackParent);
     }
     // If it is not a Cut operation, execute regular paste
     else
     {
         bool customParentIsSelected = GetIsCustomParentSelected(fallbackParent);
         Unsupported.PasteGameObjectsFromPasteboard();
         if (customParentIsSelected)
         {
             Selection.activeTransform.SetParent(fallbackParent, true);
         }
     }
 }
        internal static void PasteGOAsChild()
        {
            Transform[] selected = Selection.transforms;

            // paste as a child if a gameObject is selected
            if (selected.Length == 1)
            {
                Scene subScene        = new Scene();
                bool  pasteToSubScene = false;
                bool  isSubScene      = false;

                // If target is subScene make sure we just move objects under subScene
                if (SubSceneGUI.IsSubSceneHeader(selected[0].gameObject))
                {
                    subScene        = SubSceneGUI.GetSubScene(selected[0].gameObject);
                    isSubScene      = subScene.isSubScene;
                    pasteToSubScene = subScene.IsValid();
                }

                // handle paste after cut
                if (CutBoard.hasCutboardData)
                {
                    if (pasteToSubScene)
                    {
                        if (subScene.handle != 0)
                        {
                            CutBoard.PasteToScene(subScene, selected[0]);
                            pastedGameObjects?.Invoke(Selection.gameObjects);
                        }
                    }
                    else if (!isSubScene)
                    {
                        CutBoard.PasteAsChildren(selected[0]);
                        pastedGameObjects?.Invoke(Selection.gameObjects);
                    }
                }
                // paste after copy
                else if (pasteToSubScene || !isSubScene)
                {
                    Unsupported.PasteGameObjectsFromPasteboard(selected[0], pasteToSubScene ? subScene.handle : 0);
                    pastedGameObjects?.Invoke(Selection.gameObjects);
                }
            }
            RepaintHierarchyWindowsAfterPaste();
        }
Esempio n. 3
0
        internal static void PasteGOAsChild()
        {
            Transform[] selected = Selection.transforms;

            // paste as a child if a gameObject is selected
            if (selected.Length == 1)
            {
                // handle paste after cut
                if (CutBoard.hasCutboardData)
                {
                    CutBoard.PasteAsChildren(selected[0]);
                }
                // paste after copy
                else
                {
                    Unsupported.PasteGameObjectsFromPasteboard(selected[0]);
                }
            }
            RepaintHierarchyWindowsAfterPaste();
        }
Esempio n. 4
0
 private void PasteGO()
 {
     Unsupported.PasteGameObjectsFromPasteboard();
 }