private void AfterCreateGameObjectMenuItemWasExecuted(string menuPath, UnityEngine.Object[] contextObjects, int userData)
 {
     EditorSceneManager.SetTargetSceneForNewGameObjects(0);
     if (this.m_Locked)
     {
         this.m_FrameOnSelectionSync = true;
     }
 }
        public static GameObject CreateGameObject(Scene scene, HideFlags hideFlags, string name, params Type[] types)
        {
            if (!scene.IsValid())
            {
                throw new ArgumentException("Cannot create a GameObject to a null Scene.");
            }

            //Internally, this sets the target scene that the scene points to.
            EditorSceneManager.SetTargetSceneForNewGameObjects(scene);
            var go = CreateGameObject(name, types);

            go.hideFlags = hideFlags;
            EditorSceneManager.ClearTargetSceneForNewGameObjects();
            return(go);
        }
 private void BeforeCreateGameObjectMenuItemWasExecuted(string menuPath, UnityEngine.Object[] contextObjects, int userData)
 {
     EditorSceneManager.SetTargetSceneForNewGameObjects(userData);
 }
        private void BeforeCreateGameObjectMenuItemWasExecuted(string menuPath, Object[] contextObjects, int userData)
        {
            int sceneHandle = userData;

            EditorSceneManager.SetTargetSceneForNewGameObjects(sceneHandle);
        }