Actually the GO setup is implementing a state machine through object activation/deactivation and is instantiated from game data. It does its job but has its flaws.
Enemy (higher level scripts): this root object never moves
- EnemyPrefab (Only MeshRenderer and colliders): the object to move
- ExitSpawnMovement (instantiated from a prefab with preconfigured Move controller script and a movement script): position of this object places (for example) a spline at the correct location
- ApproachMovement (idem)
- AttackMovement (idem)
Only one ***Movement object is active at a time.
I would have used the SplineController in place of our own move controller and put the spline on the same object... which is a bad idea right now and why I would have loved to be able to choose which object is moved by the controller. I'll certainly rewrite a controller for my special case but thought about the suggestion above which *might* have worked off the shelf.
Enemy (higher level scripts): this root object never moves
- EnemyPrefab (Only MeshRenderer and colliders): the object to move
- ExitSpawnMovement (instantiated from a prefab with preconfigured Move controller script and a movement script): position of this object places (for example) a spline at the correct location
- ApproachMovement (idem)
- AttackMovement (idem)
Only one ***Movement object is active at a time.
I would have used the SplineController in place of our own move controller and put the spline on the same object... which is a bad idea right now and why I would have loved to be able to choose which object is moved by the controller. I'll certainly rewrite a controller for my special case but thought about the suggestion above which *might* have worked off the shelf.