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);
                }
            }
        }
Esempio 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);
            }
        }