Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_LifetimeComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted", description: "")]
2 class SCR_LifetimeComponentClass : ScriptComponentClass
3 {
4 }
5 
7 class SCR_LifetimeComponent : ScriptComponent
8 {
9  [Attribute(defvalue: "1")]
10  protected float m_fLifeTime;
11 
12  //------------------------------------------------------------------------------------------------
13  override void EOnFrame(IEntity owner, float timeSlice)
14  {
15  if (m_fLifeTime < 0)
16  {
17  SCR_EntityHelper.DeleteEntityAndChildren(owner);
18  return;
19  }
20  m_fLifeTime -= timeSlice;
21  }
22 
23  //------------------------------------------------------------------------------------------------
24  override void OnPostInit(IEntity owner)
25  {
26  SetEventMask(owner, EntityEvent.FRAME);
27  }
28 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
SCR_EntityHelper
Definition: SCR_EntityHelper.c:1
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
EOnFrame
override void EOnFrame(IEntity owner, float timeSlice)
Definition: SCR_PlayerProfileManagerComponent.c:199
SCR_LifetimeComponentClass
Definition: SCR_LifetimeComponent.c:2
OnPostInit
override void OnPostInit(IEntity owner)
Called on PostInit when all components are added.
Definition: SCR_LifetimeComponent.c:24
Attribute
SCR_LifetimeComponentClass ScriptComponentClass Attribute(defvalue:"1")
Delete entity after given duration.
Definition: SCR_LifetimeComponent.c:9
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180