Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkOnAnimationEvent.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Entity to listen animation events on")]
5 ref SCR_ScenarioFrameworkGet m_Getter;
6
7 [Attribute("", UIWidgets.Auto)]
8 string m_sAnimationEventString;
9
10 [Attribute(desc: "Actions to be executed if conditions' evaluation is successful.")]
11 ref array<ref SCR_ScenarioFrameworkActionBase> m_aActions;
12
13 SCR_CharacterControllerComponent m_CharController;
14
15 //------------------------------------------------------------------------------------------------
16 override void OnActivate(IEntity object)
17 {
18 if (!CanActivate())
19 return;
20
21 IEntity entity;
22 if (!ValidateInputEntity(object, m_Getter, entity))
23 return;
24
26
27 if (m_CharController)
28 {
29 m_CharController.GetOnAnimationEvent().Remove(OnAnimationEvent);
30 m_CharController.GetOnAnimationEvent().Insert(OnAnimationEvent);
31 }
32 }
33
34 //------------------------------------------------------------------------------------------------
36 void OnAnimationEvent(AnimationEventID animEventType, AnimationEventID animUserString, int intParam, float timeFromStart, float timeToEnd)
37 {
38 string eventName = GameAnimationUtils.GetEventString(animEventType);
39
40 if (eventName == m_sAnimationEventString)
41 {
42 foreach (SCR_ScenarioFrameworkActionBase actions : m_aActions)
43 {
44 actions.OnActivate(m_Entity);
45 }
46 }
47 }
48
49 //------------------------------------------------------------------------------------------------
50 override array<ref SCR_ScenarioFrameworkActionBase> GetSubActions()
51 {
52 array<ref SCR_ScenarioFrameworkActionBase> allActions = {};
53
54 foreach (SCR_ScenarioFrameworkActionBase action : m_aActions)
55 {
56 allActions.Insert(action);
57 }
58
59 return allActions;
60 }
61}
int AnimationEventID
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
SCR_FieldOfViewSettings Attribute