Ejemplo n.º 1
0
        public void ProjectSelectionOnProjectionSurface()
        {
            if (NumberOfSelectedObjects == 0)
            {
                return;
            }

            if (!ObjectOnSurfaceProjectSettings.ProjectOnGrid)
            {
                GameObject projectionSurface = ObjectOnSurfaceProjectSettings.ProjectionSurface;
                if (projectionSurface == null)
                {
                    return;
                }

                Vector3 projectionDirection = ObjectOnSurfaceProjectSettings.GetProjectionDirectionVector();
                GameObjectExtensions.EmbedAllObjectsInSurface(new List <GameObject>(_selectedObjects.HashSet), projectionDirection, projectionSurface);

                _objectSelectionGizmos.OnObjectSelectionUpdated();
            }
            else
            {
                Vector3 projectionDirection = ObjectOnSurfaceProjectSettings.GetProjectionDirectionVector();
                GameObjectExtensions.ProjectAllObjectsOnPlane(new List <GameObject>(_selectedObjects.HashSet), projectionDirection, ObjectSnapping.Get().XZSnapGrid.Plane);

                _objectSelectionGizmos.OnObjectSelectionUpdated();
            }
        }
Ejemplo n.º 2
0
        public void ProjectSelectionOnProjectionSurface()
        {
            if (NumberOfSelectedObjects == 0)
            {
                return;
            }

            GameObject projectionSurface = ObjectOnSurfaceProjectSettings.ProjectionSurface;

            if (projectionSurface == null)
            {
                return;
            }

            Vector3 projectionDirection = ObjectOnSurfaceProjectSettings.GetProjectionDirectionVector();

            GameObjectExtensions.EmbedAllObjectsInSurface(new List <GameObject>(_selectedObjects.HashSet), projectionDirection, projectionSurface);

            _objectSelectionTransformGizmoSystem.OnObjectSelectionUpdated();
        }