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);
                }
            }
        }
예제 #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);
            }
        }
예제 #3
0
        public static void EraseGameObjectsInAllLayers()
        {
            List <GameObject> allGameObjectsInAllLayers = ObjectLayerDatabase.Get().GetAllGameObjectsInAllLayers();

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

            ObjectErase.EraseGameObjectCollection(allGameObjectsInLayer);
        }
예제 #5
0
 public static void EraseAllSelectedGameObjects()
 {
     ObjectErase.EraseGameObjectCollection(ObjectSelection.Get().GetAllSelectedGameObjects());
 }