1 [
ComponentEditorProps(
category:
"GameScripted/Editor", description:
"Attribute for managing editable entities. Works only with SCR_EditorBaseEntity!", icon:
"WBData/ComponentEditorProps/componentEditor.png")]
15 private ref map<ResourceName, ref array<ResourceName>> m_PrefabsCache =
new map<ResourceName, ref array<ResourceName>>;
17 bool IsPrefabInherited(ResourceName prefab, ResourceName inheritedFrom)
19 if (prefab == ResourceName.Empty || inheritedFrom == ResourceName.Empty)
return false;
21 array<ResourceName> inheritance =
new array<ResourceName>;
22 if (!m_PrefabsCache.Contains(inheritedFrom))
24 Resource resource = Resource.Load(inheritedFrom);
25 if (resource.IsValid())
30 inheritance.Insert(source.GetResourceName());
31 source = source.GetAncestor();
33 m_PrefabsCache.Insert(inheritedFrom, inheritance);
38 inheritance = m_PrefabsCache.Get(inheritedFrom);
41 return inheritance.Find(prefab) != -1;