diff --git a/src/Templates/EntityTemplate/Editor/ComponentTemplatePropertyDrawer.cs b/src/Templates/EntityTemplate/Editor/ComponentTemplatePropertyDrawer.cs index dcda40c..f19db99 100644 --- a/src/Templates/EntityTemplate/Editor/ComponentTemplatePropertyDrawer.cs +++ b/src/Templates/EntityTemplate/Editor/ComponentTemplatePropertyDrawer.cs @@ -30,7 +30,6 @@ namespace DCFApixels.DragonECS.Unity.Editors internal class ComponentTemplateReferenceDrawer : ExtendedPropertyDrawer { private const float DamagedComponentHeight = 18f * 2f; - private static readonly Rect HeadIconsRect = new Rect(0f, 0f, 19f, 19f); private static ComponentDropDown _componentDropDown; #region Properties diff --git a/src/Templates/EntityTemplate/Editor/EntityTemplateEditor.cs b/src/Templates/EntityTemplate/Editor/EntityTemplateEditor.cs index f2c59e3..fad360d 100644 --- a/src/Templates/EntityTemplate/Editor/EntityTemplateEditor.cs +++ b/src/Templates/EntityTemplate/Editor/EntityTemplateEditor.cs @@ -9,8 +9,6 @@ namespace DCFApixels.DragonECS.Unity.Editors { internal abstract class EntityTemplateEditorBase : ExtendedEditor { - private static readonly Rect HeadIconsRect = new Rect(0f, 0f, 19f, 19f); - private ComponentDropDown _componentDropDown; private SerializedProperty _componentsProp; @@ -184,10 +182,23 @@ namespace DCFApixels.DragonECS.Unity.Editors } } - using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetTransperentBlackBackgrounStyle())) + + SerializedProperty iterator = serializedObject.GetIterator(); + iterator.NextVisible(true); + while (iterator.NextVisible(false)) { - DrawTop(Target, _componentsProp); - _reorderableComponentsList.DoLayoutList(); + if (iterator.name == _componentsProp.name) + { + using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetTransperentBlackBackgrounStyle())) + { + DrawTop(Target, _componentsProp); + _reorderableComponentsList.DoLayoutList(); + } + } + else + { + EditorGUILayout.PropertyField(iterator, true); + } } } private void DrawTop(IEntityTemplateInternal target, SerializedProperty componentsProp) diff --git a/src/Templates/EntityTemplate/Templates/ScriptableEntityTemplate.cs b/src/Templates/EntityTemplate/Templates/ScriptableEntityTemplate.cs index 996e656..460f601 100644 --- a/src/Templates/EntityTemplate/Templates/ScriptableEntityTemplate.cs +++ b/src/Templates/EntityTemplate/Templates/ScriptableEntityTemplate.cs @@ -20,6 +20,8 @@ namespace DCFApixels.DragonECS [MetaID("DragonECS_7C4DBA809201D959401A5BDFB6363EC0")] public class ScriptableEntityTemplate : ScriptableEntityTemplateBase, IEntityTemplateInternal { + [SerializeField] + private ScriptableEntityTemplateBase[] _templates; [SerializeReference] [ReferenceButton(true, typeof(IComponentTemplate))] private IComponentTemplate[] _components; @@ -34,6 +36,10 @@ namespace DCFApixels.DragonECS #region Methods public override void Apply(short worldID, int entityID) { + foreach (var template in _templates) + { + template.Apply(worldID, entityID); + } foreach (var item in _components) { item.Apply(worldID, entityID);