Class MyEntityReferenceComponent
Reference counting component for entities.
Allows simplified management of short lived entities that may be shared amongst systems.
The count is initially 0 so the first referencee becomes the owner of the entity (this is sometimes called a floating reference).
Inherited Members
Namespace: Sandbox.Game.EntityComponents
Assembly: Sandbox.Game.dll
Syntax
public class MyEntityReferenceComponent : MyEntityComponentBase, IMyEntityComponentBase, IMyComponentBase
Constructors
MyEntityReferenceComponent()
Declaration
public MyEntityReferenceComponent()
Properties
ComponentTypeDebugString
Declaration
public override string ComponentTypeDebugString { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Methods
Ref()
Increase the reference count of this entity.
Declaration
public void Ref()
Unref()
Decrease the entitie's reference count.
Declaration
public bool Unref()
Returns
Type | Description |
---|---|
System.Boolean | Weather the count reached 0 and the entity was marked for close. |