private void ProjectRenderPointsOnHoveredObject()
 {
     if (HasCursorPickedMeshObject() || HasCursorPickedTerrainObject())
     {
         var pointsProjector = new PointsOnColliderProjector(_cursorRayHit.ClosestObjectRayHit.HitCollider, Plane);
         _renderPoints = pointsProjector.ProjectPoints(_renderPoints);
     }
 }
Пример #2
0
        private void CreateSurfaceColliderProjector()
        {
            MouseCursorRayHit brushCursorRayHit = _workingBrushCircle.CursorRayHit;

            if (brushCursorRayHit.WasAnObjectHit)
            {
                GameObjectRayHit objectRayHit = brushCursorRayHit.ClosestObjectRayHit;
                if (objectRayHit.WasMeshHit)
                {
                    _surfaceColliderProjector = new PointsOnColliderProjector(objectRayHit.ObjectMeshHit.HitCollider, _workingBrushCircle.Plane);
                }
                else
                if (objectRayHit.WasTerrainHit)
                {
                    _surfaceColliderProjector = new PointsOnColliderProjector(objectRayHit.ObjectTerrainHit.HitCollider, _workingBrushCircle.Plane);
                }
                else
                if (objectRayHit.WasSpriteHit)
                {
                    _surfaceColliderProjector = new PointsOnColliderProjector(objectRayHit.ObjectSpriteHit.HitCollider, _workingBrushCircle.Plane);
                }
            }
        }