Пример #1
0
 public void Disconnect()
 {
     if (bDestroyOnDisconnect)
     {
         dummyGO.Destroy();
     }
     FUtil.SafeSendEvent(OnDisconnected, this, EventArgs.Empty);
 }
Пример #2
0
 public override void Disconnect(bool bDestroy)
 {
     sceneParentGO.SetParent(null);
     base.Disconnect(bDestroy);
     if (bDestroy)
     {
         sceneParentGO.Destroy();
     }
 }
Пример #3
0
 public void Destroy()
 {
     foreach (var go in Allocated)
     {
         go.Destroy();
     }
     Allocated.Clear();
     Free.Clear();
     pool_parent.Destroy();
 }
Пример #4
0
        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);
            }
        }
Пример #5
0
        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;
            }
        }
Пример #6
0
 public static void DestroyGO(fGameObject go)
 {
     go.SetParent(null);
     go.Destroy();
 }