Api Editor MapDoc MapEntity
class

MapEntity

public sealed class MapEntity : MapNode

MapEntity in Hammer is a type of MapNode that has a set of key/value pairs. The keyvalues represent the authoritative state of the entity. Entities may have helpers that enhance the presentation and sometimes modification of those keyvalues. The helpers may come and go; it should always be possible to recreate the helpers from the parent entity's keyvalues. Entities may also have zero or more MapMesh children.

Constructors

MapEntity(MapDocument mapDocument)

Properties

Name Type Description
SerializedObject SerializedObject
MapClass MapClass
TypeDescription TypeDescription
ClassName String Entity class name like prop_physics

Methods

String GetKeyValue(String key)

Gets the value for the key, e.g "model" could return "models/props_c17/oildrum001_explosive.mdl"

Void SetKeyValue(String key, String value)

Sets the value for the key, e.g "model" could be set to "models/props_c17/oildrum001_explosive.mdl"

Void SetDefaultBounds(Vector3 min, Vector3 max)

Sets the default bounds of the entity if it doesn't have a model. By default this is 16x16x16.

Assembly: Sandbox.Tools Namespace: Editor.MapDoc Full Name: Editor.MapDoc.MapEntity