Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CharacterPerceivableComponent.c
Go to the documentation of this file.
2 {
3 }
4 
5 class SCR_CharacterPerceivableComponent : CharacterPerceivableComponent
6 {
8 
9  //------------------------------------------------------------------------------------------------
10  override void EOnInit(IEntity owner)
11  {
12  ChimeraCharacter character = ChimeraCharacter.Cast(owner);
13  if (!character)
14  return;
15 
16  m_CharacterController = SCR_CharacterControllerComponent.Cast(character.GetCharacterController());
17 
19  m_CharacterController.m_OnLifeStateChanged.Insert(OnLifeStateChanged);
20  }
21 
22  //------------------------------------------------------------------------------------------------
23  // destructor
25  {
27  m_CharacterController.m_OnLifeStateChanged.Remove(OnLifeStateChanged);
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  protected void OnLifeStateChanged(ECharacterLifeState previousLifeState, ECharacterLifeState newLifeState)
32  {
33  bool disarmed = newLifeState != ECharacterLifeState.ALIVE;
34  SetDisarmed(disarmed);
35  }
36 }
CharacterPerceivableComponentClass
Definition: CharacterPerceivableComponent.c:12
ECharacterLifeState
ECharacterLifeState
Definition: ECharacterLifeState.c:12
SetDisarmed
proto external void SetDisarmed(bool disarmed)
m_CharacterController
SCR_CharacterPerceivableComponentClass m_CharacterController
func
func
Definition: SCR_AIThreatSystem.c:5
SCR_CharacterControllerComponent
Definition: SCR_CharacterControllerComponent.c:35
EOnInit
override void EOnInit(IEntity owner)
Definition: SCR_CharacterPerceivableComponent.c:10
~SCR_CharacterPerceivableComponent
void ~SCR_CharacterPerceivableComponent()
Definition: SCR_CharacterPerceivableComponent.c:24
SCR_CharacterPerceivableComponentClass
Definition: SCR_CharacterPerceivableComponent.c:1
OnLifeStateChanged
protected void OnLifeStateChanged(ECharacterLifeState previousLifeState, ECharacterLifeState newLifeState)
Will be called when the life state of the character changes.
Definition: SCR_CharacterPerceivableComponent.c:31