@@ -86,9 +86,6 @@ public Actor Root
8686 private Dictionary < Type , ActorComponent > _actorComponents = new Dictionary < Type , ActorComponent > ( ) ;
8787 private readonly Dictionary < Type , object > _actorComponentsAndData = new ( ) ;
8888
89- [ field: SerializeField ]
90- public EntityTemplateAsset EntityTemplate { get ; private set ; }
91-
9289 [ SerializeField , ReadOnly ]
9390 private List < ActorComponent > _allComponents = new List < ActorComponent > ( ) ;
9491
@@ -572,7 +569,6 @@ int GetPriority(Component c)
572569 foreach ( var component in _allComponents )
573570 component . SetActor ( this ) ;
574571
575- EditorApplyEntityTemplate ( ) ;
576572 EditorValidateAllComponentDependencies ( ) ;
577573 ValidateSetup ( ) ;
578574 EditorUpdateUnusedDependencies ( ) ;
@@ -692,44 +688,7 @@ private void EditorValidateActorComponentsDependencies()
692688 EditorUpdateMissingActorDependenciesList ( ) ;
693689 }
694690
695- private void EditorApplyEntityTemplate ( )
696- {
697- if ( EntityTemplate == null )
698- return ;
699-
700- var componentTypes = EntityTemplate . GetComponentTypes ( ) ;
701-
702- List < Type > providersToAdd = new List < Type > ( ) ;
703-
704- foreach ( var type in componentTypes )
705- {
706- Type providerType = EntityComponentProviderFinder . FindEntityComponentProviderMatching ( type ) ;
707-
708- if ( providerType != null )
709- {
710- if ( _allComponents . Exists ( c => c . GetType ( ) == providerType ) )
711- continue ;
712- if ( _entityComponentsMissing . Exists ( c => c . GetType ( ) == type ) )
713- continue ;
714-
715- providersToAdd . Add ( providerType ) ;
716- }
717- }
718-
719- if ( providersToAdd . Count > 0 )
720- {
721- UnityEditor . EditorApplication . delayCall += ( ) =>
722- {
723- if ( this == null ) return ;
724-
725- foreach ( var provider in providersToAdd )
726- if ( gameObject . GetComponent ( provider ) == null )
727- UnityEditor . Undo . AddComponent ( gameObject , provider ) ;
728-
729- UnityEditor . EditorUtility . SetDirty ( gameObject ) ;
730- } ;
731- }
732- }
691+
733692
734693 public List < string > EditorGetMissingDependenciesNamesForAllComponents ( EditorDependenciesType dependenciesType )
735694 {
@@ -880,11 +839,8 @@ public List<ActorComponent> EditorGetUnusedActorComponentsForComponent(ActorComp
880839
881840 public bool EditorHasUnusedDependencies ( ) => _editorUnusedDependencies . Count > 0 ;
882841
883- public void EditorSetEntityTemplate ( EntityTemplateAsset entityTemplateAsset )
884- {
885- EntityTemplate = entityTemplateAsset ;
886- EditorApplyEntityTemplate ( ) ;
887- }
842+ public List < ActorComponent > EditorGetAllComponentsSerialized ( ) => _allComponents ;
843+ public List < IEntityComponent > EditorGetEntityComponentsMissingSerialized ( ) => _entityComponentsMissing ;
888844#endif
889845 }
890846}
0 commit comments