fix: unassigned fields on factories

This commit is contained in:
Syntriax 2025-03-29 10:30:31 +03:00
parent 4ec1a32db2
commit b9ee1ec232
2 changed files with 6 additions and 0 deletions

View File

@ -13,6 +13,9 @@ public class BehaviourControllerFactory
{ {
T behaviourController = TypeFactory.Get<T>(args); T behaviourController = TypeFactory.Get<T>(args);
if (!hierarchyObject.Assign(behaviourController))
throw AssignException.From(hierarchyObject, behaviourController);
if (!behaviourController.Assign(hierarchyObject)) if (!behaviourController.Assign(hierarchyObject))
throw AssignException.From(behaviourController, hierarchyObject); throw AssignException.From(behaviourController, hierarchyObject);

View File

@ -11,6 +11,9 @@ public class StateEnableFactory
{ {
T stateEnable = TypeFactory.Get<T>(args); T stateEnable = TypeFactory.Get<T>(args);
if (!entity.Assign(stateEnable))
throw AssignException.From(entity, stateEnable);
if (!stateEnable.Assign(entity)) if (!stateEnable.Assign(entity))
throw AssignException.From(stateEnable, entity); throw AssignException.From(stateEnable, entity);