Game.Tools.Snap
Assembly:
Namespace: Game.Tools
Type: Enum
Base: System.Enum (underlying type: System.UInt32)
Summary:
Snap is a [Flags] enumeration used by in-game tools to control snapping behavior when placing or editing objects, networks and terrain. Each flag represents a distinct snapping rule (grid, geometry, network sides/middle/nodes, shoreline, contour lines, etc.). Flags can be combined with bitwise operations to enable multiple snapping behaviors simultaneously.
Fields
-
ExistingGeometry = 1u
Snaps to existing geometry (vertices/edges) of placed objects or the environment. -
CellLength = 2u
Snaps to a fixed cell/grid length (useful for regular spacing). -
StraightDirection = 4u
Forces alignment to straight directions (e.g., lock orientation to cardinal/major directions). -
NetSide = 8u
Snaps to the side of network segments (e.g., road edges). -
NetArea = 0x10u
Snaps to the area defined by networks (useful for aligning to the footprint/area of networks). -
OwnerSide = 0x20u
Snaps relative to the owner's side (e.g., property boundary orientation). -
ObjectSide = 0x40u
Snaps to the side/edge of objects (object bounding edges). -
NetMiddle = 0x80u
Snaps to the middle/centerline of network segments. -
Shoreline = 0x100u
Snaps to the shoreline (water-land boundary). -
NearbyGeometry = 0x200u
Snaps to nearby geometry within a proximity threshold. -
GuideLines = 0x400u
Snaps to guide lines (user or tool-provided alignment aids). -
ZoneGrid = 0x800u
Snaps to the zoning grid used for district/zone alignment. -
NetNode = 0x1000u
Snaps to network nodes (junctions/intersections). -
ObjectSurface = 0x2000u
Snaps to object surfaces (aligns to object's surface normal/height). -
Upright = 0x4000u
Enforces upright orientation (prevents tilting). -
LotGrid = 0x8000u
Snaps to the lot grid (parcel-level alignment). -
AutoParent = 0x10000u
Automatically parents placed objects to nearby compatible parents (hierarchical attachment). -
PrefabType = 0x20000u
Considers prefab type when snapping (match orientation/placement rules for the prefab class). -
ContourLines = 0x40000u
Snaps to terrain contour lines (elevation contours). -
Distance = 0x80000u
Snaps by a distance increment or proximity-based stepping. -
None = 0u
Disables snapping (no snapping rules applied). -
All = uint.MaxValue
Enables all snapping behaviors (all bits set).
Properties
- (none)
This enum only defines flags; there are no properties.
Constructors
- (none)
Enums do not define constructors beyond the implicit default values.
Methods
- (none)
This enum provides only flag values; no methods are defined.
Usage Example
// Combine multiple snapping behaviors
Snap snapMode = Snap.ExistingGeometry | Snap.NetSide | Snap.Upright;
// Check a flag (bitwise)
bool snapsToNetSide = (snapMode & Snap.NetSide) != 0;
// Or using Enum.HasFlag (slower, but readable)
bool isUpright = snapMode.HasFlag(Snap.Upright);
// Disable snapping
snapMode = Snap.None;
// Enable everything
snapMode = Snap.All;