Show / Hide Table of Contents

Class Entity

Represents an Entity.

Inheritance
Object
Entity
Namespace: Modding.Levels
Assembly: Assembly-CSharp.dll
Syntax
public class Entity

Properties

Behaviour

The behaviour associated with this entity.

This mostly handles the logic system.

Declaration
public EntityBehaviour Behaviour { get; }
Property Value
Type Description
EntityBehaviour

BuildEntity

A reference to the building mode version of this entity.

Declaration
public Entity BuildEntity { get; }
Property Value
Type Description
Entity

GameObject

GameObject of this entity.

Declaration
public GameObject GameObject { get; }
Property Value
Type Description
UnityEngine.GameObject

Id

Unique identifier of this entity.

This is the same for the building mode entity and its simulation clone.

Declaration
public long Id { get; }
Property Value
Type Description
Int64

InternalObject

Internal representation of this object.

WARNING: This is not part of the stable API and subject to change!

Declaration
public LevelEntity InternalObject { get; }
Property Value
Type Description
LevelEntity

IsBuildZone

Whether this entity is a build zone.

Declaration
public bool IsBuildZone { get; }
Property Value
Type Description
Boolean

IsBurning

Whether this entity is currently burning.

Declaration
public bool IsBurning { get; }
Property Value
Type Description
Boolean

IsDestroyed

Whether this entity was destroyed.

Declaration
public bool IsDestroyed { get; }
Property Value
Type Description
Boolean

IsSelected

Whether this entity is selected by the local player.

Declaration
public bool IsSelected { get; }
Property Value
Type Description
Boolean

Name

Name of this entity.

The prefab name by default, or a custom name set in the BlockMapper.

Declaration
public string Name { get; set; }
Property Value
Type Description
String

PhysicsEnabled

Whether this entity has its physics enabled.

Declaration
public bool PhysicsEnabled { get; }
Property Value
Type Description
Boolean

Prefab

The prefab / type of this entity.

Declaration
public EntityPrefabInfo Prefab { get; }
Property Value
Type Description
EntityPrefabInfo

SimEntity

A reference to the simulation clone of this entity.

Null in building mode.

Note that building zones do not have simulation clones, SimEntity is always null for them.

Declaration
public Entity SimEntity { get; }
Property Value
Type Description
Entity

Methods

Equals(Entity)

Declaration
protected bool Equals(Entity other)
Parameters
Type Name Description
Entity other
Returns
Type Description
Boolean

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj
Returns
Type Description
Boolean
Overrides
Object.Equals(Object)

From(LevelEntity)

Create an Entity from its internal representation.

Declaration
public static Entity From(LevelEntity levelEntity)
Parameters
Type Name Description
LevelEntity levelEntity
Returns
Type Description
Entity

From(Int64)

Create an Entity object from its id.

Declaration
public static Entity From(long id)
Parameters
Type Name Description
Int64 id
Returns
Type Description
Entity

From(GameObject)

Create an Entity object from its GameObject.

Declaration
public static Entity From(GameObject entityObject)
Parameters
Type Name Description
UnityEngine.GameObject entityObject
Returns
Type Description
Entity

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32
Overrides
Object.GetHashCode()

Select(Boolean)

Marks the entity as selected for the local user.

Note that this does not actually select the entity for any of the normal tools, it just adds the visual effect.

Declaration
public void Select(bool selected)
Parameters
Type Name Description
Boolean selected

SetOnFire(Boolean)

Set the on fire state of this entity.

No-op if the entity cannot burn.

Declaration
public void SetOnFire(bool onFire)
Parameters
Type Name Description
Boolean onFire

ToString()

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
Object.ToString()

Operators

Equality(Entity, Entity)

Declaration
public static bool operator ==(Entity left, Entity right)
Parameters
Type Name Description
Entity left
Entity right
Returns
Type Description
Boolean

Inequality(Entity, Entity)

Declaration
public static bool operator !=(Entity left, Entity right)
Parameters
Type Name Description
Entity left
Entity right
Returns
Type Description
Boolean
Back to top Generated by DocFX