Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionCallAnimationCommand.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Target entity (Entity has to have Character Animation componnent)")]
5 ref SCR_ScenarioFrameworkGet m_Getter;
6
7 [Attribute(desc: "Name of the animation command. E.g CMD_Gestures")]
8 string m_sAnimationCommand;
9
10 [Attribute(desc: "ID of animation can be found in animation graph.", params: "0 inf")]
11 int m_iAnimId;
12
13 [Attribute(SCR_EAnimationState.START.ToString(), UIWidgets.ComboBox, "Set if the animation should start or stop.", "", enumType: SCR_EAnimationState)]
14 SCR_EAnimationState m_eState;
15
16 //------------------------------------------------------------------------------------------------
17 override void OnActivate(IEntity object)
18 {
19 if (!CanActivate())
20 return;
21
22 IEntity entity;
23 if (!ValidateInputEntity(object, m_Getter, entity))
24 return;
25
26 SCR_CharacterAnimationComponent animationComponent = SCR_CharacterAnimationComponent.Cast(entity.FindComponent(SCR_CharacterAnimationComponent));
27 if (!animationComponent)
28 {
29 if (object)
30 PrintFormat("ScenarioFramework Action: Animation component not found for Action %1 attached on %2.", this, object.GetName(), level: LogLevel.ERROR);
31 else
32 PrintFormat("ScenarioFramework Action: Animation component not found for Action %1.", this, level: LogLevel.ERROR);
33
34 return;
35 }
36
37 TAnimGraphCommand commandId = animationComponent.BindCommand(m_sAnimationCommand);
38
39 switch (m_eState)
40 {
41 case SCR_EAnimationState.START:
42 {
43 animationComponent.CallCommand4I(commandId, 0, m_iAnimId, 0, 0, 0);
44 break;
45 }
46 case SCR_EAnimationState.STOP:
47 {
48 animationComponent.CallCommand(commandId, -1, m_iAnimId);
49 break;
50 }
51 }
52 }
53}
int TAnimGraphCommand
Definition ECommandIDs.c:1
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
SCR_EAnimationState
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
SCR_FieldOfViewSettings Attribute