Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PrefabsCacheEditorComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/Editor", description: "Attribute for managing editable entities. Works only with SCR_EditorBaseEntity!", icon: "WBData/ComponentEditorProps/componentEditor.png")]
3 {
4 };
5 
14 {
15  private ref map<ResourceName, ref array<ResourceName>> m_PrefabsCache = new map<ResourceName, ref array<ResourceName>>;
16 
17  bool IsPrefabInherited(ResourceName prefab, ResourceName inheritedFrom)
18  {
19  if (prefab == ResourceName.Empty || inheritedFrom == ResourceName.Empty) return false;
20 
21  array<ResourceName> inheritance = new array<ResourceName>;
22  if (!m_PrefabsCache.Contains(inheritedFrom))
23  {
24  Resource resource = Resource.Load(inheritedFrom);
25  if (resource.IsValid())
26  {
27  IEntitySource source = SCR_BaseContainerTools.FindEntitySource(resource);
28  while (source)
29  {
30  inheritance.Insert(source.GetResourceName());
31  source = source.GetAncestor();
32  }
33  m_PrefabsCache.Insert(inheritedFrom, inheritance);
34  }
35  }
36  else
37  {
38  inheritance = m_PrefabsCache.Get(inheritedFrom);
39  }
40 
41  return inheritance.Find(prefab) != -1;
42  }
43 };
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
SCR_PrefabsCacheEditorComponent
Definition: SCR_PrefabsCacheEditorComponent.c:13
SCR_PrefabsCacheEditorComponentClass
Definition: SCR_PrefabsCacheEditorComponent.c:2
SCR_BaseEditorComponent
Definition: SCR_BaseEditorComponent.c:119
SCR_BaseEditorComponentClass
Definition: SCR_BaseEditorComponent.c:2
SCR_BaseContainerTools
Definition: SCR_BaseContainerTools.c:3
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180