Show / Hide Table of Contents

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).

Inheritance
System.Object
MyComponentBase
MyEntityComponentBase
MyEntityReferenceComponent
Inherited Members
MyEntityComponentBase.OnAddedToContainer()
MyEntityComponentBase.OnBeforeRemovedFromContainer()
MyEntityComponentBase.Container
MyEntityComponentBase.Entity
MyEntityComponentBase.AttachSyncToEntity
MyEntityComponentBase.OnAfterAddedToContainer
MyEntityComponentBase.BeforeRemovedFromContainer
MyComponentBase.SetContainer(IMyComponentContainer)
MyComponentBase.GetAs<T>()
MyComponentBase.OnAddedToScene()
MyComponentBase.OnRemovedFromScene()
MyComponentBase.Serialize(Boolean)
MyComponentBase.Deserialize(MyObjectBuilder_ComponentBase)
MyComponentBase.Init(MyComponentDefinitionBase)
MyComponentBase.IsSerialized()
MyComponentBase.RemoveExistingComponentOnNewInsert
MyComponentBase.ContainerBase
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
MyEntityComponentBase.ComponentTypeDebugString

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.

Extension Methods

MyEntityContainerEventExtensions.RegisterForEntityEvent(MyEntityComponentBase, MyStringHash, MyEntityContainerEventExtensions.EntityEventHandler)
MyEntityContainerEventExtensions.RegisterForEntityEvent(MyEntityComponentBase, MyEntity, MyStringHash, MyEntityContainerEventExtensions.EntityEventHandler)
MyEntityContainerEventExtensions.UnregisterForEntityEvent(MyEntityComponentBase, MyEntity, MyStringHash)
MyEntityContainerEventExtensions.RaiseEntityEvent(MyEntityComponentBase, MyStringHash, MyEntityContainerEventExtensions.EntityEventParams)
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾