Show / Hide Table of Contents

Class MyTriggerComponent

Inheritance
System.Object
MyComponentBase
MyEntityComponentBase
MyTriggerComponent
MyUpdateTriggerComponent
MyAreaTriggerComponent
Inherited Members
MyEntityComponentBase.Container
MyEntityComponentBase.Entity
MyEntityComponentBase.AttachSyncToEntity
MyEntityComponentBase.OnAfterAddedToContainer
MyEntityComponentBase.BeforeRemovedFromContainer
MyComponentBase.SetContainer(IMyComponentContainer)
MyComponentBase.GetAs<T>()
MyComponentBase.Init(MyComponentDefinitionBase)
MyComponentBase.RemoveExistingComponentOnNewInsert
MyComponentBase.ContainerBase
Namespace: Sandbox.Game.Components
Assembly: Sandbox.Game.dll
Syntax
[MyComponentBuilder]
public class MyTriggerComponent : MyEntityComponentBase, IMyEntityComponentBase, IMyComponentBase

Constructors

MyTriggerComponent()

Declaration
public MyTriggerComponent()

MyTriggerComponent(MyTriggerComponent.TriggerType, UInt32)

Declaration
public MyTriggerComponent(MyTriggerComponent.TriggerType type, uint updateFrequency = 300U)
Parameters
Type Name Description
MyTriggerComponent.TriggerType type
System.UInt32 updateFrequency

Fields

m_AABB

Declaration
protected BoundingBoxD m_AABB
Field Value
Type Description
BoundingBoxD

m_boundingSphere

Declaration
protected BoundingSphereD m_boundingSphere
Field Value
Type Description
BoundingSphereD

m_orientedBoundingBox

Declaration
protected MyOrientedBoundingBoxD m_orientedBoundingBox
Field Value
Type Description
MyOrientedBoundingBoxD

m_queryResult

Declaration
protected readonly List<MyEntity> m_queryResult
Field Value
Type Description
System.Collections.Generic.List<MyEntity>

m_relativeOffset

Declaration
protected Vector3 m_relativeOffset
Field Value
Type Description
Vector3

m_triggerType

Declaration
protected MyTriggerComponent.TriggerType m_triggerType
Field Value
Type Description
MyTriggerComponent.TriggerType

Properties

Center

Trigger BB center position.

Declaration
public Vector3D Center { get; set; }
Property Value
Type Description
Vector3D

ComponentTypeDebugString

Declaration
public override string ComponentTypeDebugString { get; }
Property Value
Type Description
System.String
Overrides
MyEntityComponentBase.ComponentTypeDebugString

CustomDebugColor

Declaration
public Nullable<Color> CustomDebugColor { get; set; }
Property Value
Type Description
System.Nullable<Color>

DoQuery

Declaration
protected bool DoQuery { get; set; }
Property Value
Type Description
System.Boolean

Enabled

Declaration
public virtual bool Enabled { get; protected set; }
Property Value
Type Description
System.Boolean

OBB

Declaration
public MyOrientedBoundingBoxD OBB { get; set; }
Property Value
Type Description
MyOrientedBoundingBoxD

QueryResult

Declaration
protected List<MyEntity> QueryResult { get; }
Property Value
Type Description
System.Collections.Generic.List<MyEntity>

TriggerAreaType

Declaration
public MyTriggerComponent.TriggerType TriggerAreaType { get; set; }
Property Value
Type Description
MyTriggerComponent.TriggerType

UpdateFrequency

Declaration
public uint UpdateFrequency { get; set; }
Property Value
Type Description
System.UInt32

Methods

Contains(Vector3D)

Declaration
public bool Contains(Vector3D point)
Parameters
Type Name Description
Vector3D point
Returns
Type Description
System.Boolean

DebugDraw()

Declaration
public virtual void DebugDraw()

Deserialize(MyObjectBuilder_ComponentBase)

Declaration
public override void Deserialize(MyObjectBuilder_ComponentBase builder)
Parameters
Type Name Description
MyObjectBuilder_ComponentBase builder
Overrides
MyComponentBase.Deserialize(MyObjectBuilder_ComponentBase)

Dispose()

Override for custom trigger disposal before removing.

Declaration
public virtual void Dispose()

IsSerialized()

Declaration
public override bool IsSerialized()
Returns
Type Description
System.Boolean
Overrides
MyComponentBase.IsSerialized()

OnAddedToContainer()

Declaration
public override void OnAddedToContainer()
Overrides
MyEntityComponentBase.OnAddedToContainer()

OnAddedToScene()

Declaration
public override void OnAddedToScene()
Overrides
MyComponentBase.OnAddedToScene()

OnBeforeRemovedFromContainer()

Declaration
public override void OnBeforeRemovedFromContainer()
Overrides
MyEntityComponentBase.OnBeforeRemovedFromContainer()

OnRemovedFromScene()

Declaration
public override void OnRemovedFromScene()
Overrides
MyComponentBase.OnRemovedFromScene()

QueryEvaluator(MyEntity)

Override to discard query results of your choice.

Declaration
protected virtual bool QueryEvaluator(MyEntity entity)
Parameters
Type Name Description
MyEntity entity
Returns
Type Description
System.Boolean

True for valid entities.

Serialize(Boolean)

Declaration
public override MyObjectBuilder_ComponentBase Serialize(bool copy = false)
Parameters
Type Name Description
System.Boolean copy
Returns
Type Description
MyObjectBuilder_ComponentBase
Overrides
MyComponentBase.Serialize(Boolean)

Update()

Declaration
public void Update()

UpdateInternal()

Override this function to set custom update behaviour. Call base at first because it queries objects if DoQuery is set.

Declaration
protected virtual void UpdateInternal()

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
☀
☾