refactor!: IGameObject removed
This commit is contained in:
@@ -5,16 +5,16 @@ namespace Syntriax.Engine.Core.Factory;
|
||||
|
||||
public class BehaviourControllerFactory
|
||||
{
|
||||
public IBehaviourController Instantiate(IGameObject gameObject)
|
||||
=> Instantiate<BehaviourController>(gameObject);
|
||||
public IBehaviourController Instantiate(IHierarchyObject hierarchyObject)
|
||||
=> Instantiate<BehaviourController>(hierarchyObject);
|
||||
|
||||
public T Instantiate<T>(IGameObject gameObject, params object?[]? args)
|
||||
public T Instantiate<T>(IHierarchyObject hierarchyObject, params object?[]? args)
|
||||
where T : class, IBehaviourController
|
||||
{
|
||||
T behaviourController = TypeFactory.Get<T>(args);
|
||||
|
||||
if (!behaviourController.Assign(gameObject))
|
||||
throw AssignException.From(behaviourController, gameObject);
|
||||
if (!behaviourController.Assign(hierarchyObject))
|
||||
throw AssignException.From(behaviourController, hierarchyObject);
|
||||
|
||||
return behaviourController;
|
||||
}
|
||||
|
Reference in New Issue
Block a user