Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_TreePartHierarchyV2.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
[
BaseContainerProps
()]
3
class
SCR_TreePartHierarchyV2
: Managed
4
{
5
[
Attribute
(
"-1"
,
UIWidgets
.ResourceNamePicker,
"Pick a prefab for this tree part"
,
"et"
)]
6
ResourceName
m_Prefab;
7
[
Attribute
(
""
,
UIWidgets
.Object,
""
)]
8
ref array<ref SCR_TreePartHierarchyV2> m_aChildren;
9
10
#ifdef ENABLE_DESTRUCTION
11
void
SpawnAllChildren(
IEntity
parent, array<SCR_TreePartV2> treeParts = null)
12
{
13
if
(!parent)
14
return
;
15
16
int
count = m_aChildren.Count();
17
for
(
int
i = 0; i < count; i++)
18
{
19
if
(!m_aChildren[i])
20
return
;
21
if
(m_aChildren[i].m_Prefab.GetPath() ==
"-1"
)
22
return
;
23
24
Resource
resource =
Resource
.Load(m_aChildren[i].m_Prefab);
25
if
(!resource.IsValid())
26
return
;
27
28
vector
mat[4];
29
parent.
GetTransform
(mat);
30
31
ArmaReforgerScripted
game
=
GetGame
();
32
if
(!
game
)
33
continue
;
34
35
IEntity
ent =
game
.SpawnEntityPrefab(resource);
36
37
if
(
RplSession
.Mode() ==
RplMode
.Client)
38
parent.
AddChild
(ent, -1,
EAddChildFlags
.AUTO_TRANSFORM);
39
else
parent.
AddChild
(ent, -1,
EAddChildFlags
.NONE);
40
ent.
SetTransform
(mat);
41
42
if
(treeParts)
43
{
44
SCR_TreePartV2
treePart =
SCR_TreePartV2
.Cast(ent);
45
if
(treePart)
46
{
47
treePart.m_vLockedOrigin = parent.
GetOrigin
();
48
treeParts.Insert(treePart);
49
}
50
}
51
52
m_aChildren[i].SpawnAllChildren(ent, treeParts);
53
}
54
}
55
56
void
~SCR_TreePartHierarchyV2
()
57
{
58
foreach
(
SCR_TreePartHierarchyV2
hierarchy : m_aChildren)
59
{
60
hierarchy = null;
61
}
62
m_aChildren = null;
63
}
64
#endif
65
};
game
ref DSGameConfig game
Definition
DSConfig.c:81
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
RplMode
RplMode
Mode of replication.
Definition
RplMode.c:9
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
IEntity
Definition
IEntity.c:13
IEntity::GetOrigin
proto external vector GetOrigin()
IEntity::AddChild
proto external int AddChild(notnull IEntity child, TNodeId pivot, EAddChildFlags flags=EAddChildFlags.AUTO_TRANSFORM)
Add Entity to hierarchy. Pivot is pivot index, or -1 for center of parent.
IEntity::SetTransform
proto external bool SetTransform(vector mat[4])
IEntity::GetTransform
proto external void GetTransform(out vector mat[])
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
RplSession
Definition
RplSession.c:8
SCR_TreePartHierarchyV2
Definition
SCR_TreePartHierarchyV2.c:4
SCR_TreePartV2
Definition
SCR_TreePartV2.c:9
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EAddChildFlags
EAddChildFlags
Definition
EAddChildFlags.c:13
scripts
Game
Destruction
Tree
SCR_TreePartHierarchyV2.c
Generated by
1.17.0