public static void AddGameObjectToScene(this IRTE editor, GameObject go) { Vector3 pivot = Vector3.zero; IRuntimeSelectionComponent selectionComponent = editor.GetScenePivot(); if (selectionComponent != null) { pivot = selectionComponent.SecondaryPivot; } editor.AddGameObjectToHierarchy(go); go.transform.position = pivot; go.AddComponent <ExposeToEditor>(); go.SetActive(true); editor.RegisterCreatedObjects(new[] { go }, selectionComponent != null ? selectionComponent.CanSelect : true); }