public void Disconnect() { if (bDestroyOnDisconnect) { dummyGO.Destroy(); } FUtil.SafeSendEvent(OnDisconnected, this, EventArgs.Empty); }
public override void Disconnect(bool bDestroy) { sceneParentGO.SetParent(null); base.Disconnect(bDestroy); if (bDestroy) { sceneParentGO.Destroy(); } }
public void Destroy() { foreach (var go in Allocated) { go.Destroy(); } Allocated.Clear(); Free.Clear(); pool_parent.Destroy(); }
public void RemoveAllUIElements(bool bDiscardTransientObjects = true) { while (vUIElements.Count > 0) { RemoveUIElement(vUIElements[0], true); } // discard any transient objects we have floating around if (bDiscardTransientObjects) { transient_objects.Destroy(); transient_objects = GameObjectFactory.CreateParentGO("transient"); sceneRoot.AddChild(transient_objects, false); } }
public void Reset(bool bKeepBoundsObjects = true, bool bKeepLighting = true) { ClearHistory(); ClearSelection(); RemoveAllSceneObjects(); foreach (var so in vDeleted) { so.Disconnect(true); so.RootGameObject.Destroy(); } vDeleted.Clear(); RemoveAllUIElements(); LinkManager.RemoveAllLinks(); SetCurrentTime(0); SelectionMask = null; // save bounds objects var save_bounds = vBoundsObjects; fGameObject boundsGO = null; if (bKeepBoundsObjects) { boundsGO = bounds_objects; boundsGO.SetParent(null, true); } // save lighting objects fGameObject lightingGO = null; if (bKeepLighting) { lightingGO = lighting_objects; lightingGO.SetParent(null, true); } // save camera CameraState camera_state = ActiveCamera.Manipulator().GetCurrentState(this); // make sure we get rid of any cruft sceneRoot.Destroy(); // rebuild scene initialize_scene_root(); // restore camera ActiveCamera.Manipulator().SetCurrentSceneState(this, camera_state); // restore bounds objects if (bKeepBoundsObjects) { bounds_objects.Destroy(); boundsGO.SetParent(sceneRoot, true); bounds_objects = boundsGO; vBoundsObjects = save_bounds; } // restore lighting objects if (bKeepLighting) { lighting_objects.Destroy(); lightingGO.SetParent(sceneRoot, true); lighting_objects = lightingGO; } }
public static void DestroyGO(fGameObject go) { go.SetParent(null); go.Destroy(); }