public void Perform()
        {
            MouseCursorRayHit cursorRayHit = ObjectEraser.Get().GetMouseCursorRayHit();

            if (cursorRayHit.WasAnObjectHit)
            {
                List <GameObject> objectsToErase = cursorRayHit.GetAllObjectsSortedByHitDistance();
                objectsToErase = ObjectEraser.Get().FilterObjectsWhichCanBeErased(objectsToErase);
                if (objectsToErase.Count == 0)
                {
                    return;
                }

                objectsToErase = new List <GameObject> {
                    objectsToErase[0]
                };

                bool eraseEntireHierarchy = !AllShortcutCombos.Instance.EraseIndividualObjects.IsActive();
                if (eraseEntireHierarchy)
                {
                    ObjectErase.EraseObjectHierarchiesInObjectCollection(objectsToErase);
                }
                else
                {
                    ObjectErase.EraseGameObjectCollection(objectsToErase);
                }
            }
        }
Exemplo n.º 2
0
        public void Perform()
        {
            List <GameObject> gameObjectsForMassEraseOperation = ObjectEraser.Get().GetGameObjectsForMassEraseOperation();

            bool eraseEntireHierarchy = !AllShortcutCombos.Instance.EraseIndividualObjects.IsActive();

            if (eraseEntireHierarchy)
            {
                ObjectErase.EraseObjectHierarchiesInObjectCollection(gameObjectsForMassEraseOperation);
            }
            else
            {
                ObjectErase.EraseGameObjectCollection(gameObjectsForMassEraseOperation);
            }
        }
Exemplo n.º 3
0
        public static void EraseGameObjectsInAllLayers()
        {
            List <GameObject> allGameObjectsInAllLayers = ObjectLayerDatabase.Get().GetAllGameObjectsInAllLayers();

            ObjectErase.EraseGameObjectCollection(allGameObjectsInAllLayers);
        }
Exemplo n.º 4
0
        public static void EraseAllGameObjectsInLayer(int objectLayer)
        {
            List <GameObject> allGameObjectsInLayer = ObjectLayerDatabase.Get().GetAllGameObjectsInLayer(objectLayer);

            ObjectErase.EraseGameObjectCollection(allGameObjectsInLayer);
        }
Exemplo n.º 5
0
 public static void EraseAllSelectedGameObjects()
 {
     ObjectErase.EraseGameObjectCollection(ObjectSelection.Get().GetAllSelectedGameObjects());
 }