Good way to structure monobehaviour with different movement strategies
So I'm unsure of how to best structure my movement strategies for different GameObjects.
I have a couple of different movement strategies for reaching a target GameObject or point. Two examples being: 1. shot like a bullet at the target point with no further movement control. Single parameter being bullet speed. 2. using a PN controller for something like a missile to reach a target even if moving. Some parameters being N-value, acceleration, top speed.
I want to be able to chain these type of movement commands (for example a ball is first shot like a bullet then it starts homing in on a target.) or at least easily exchange them for others.
My first strategy was basically to have an abstract Mover class that different movement strategies inherited from. Making a MonoBehaviour with a public list of this abstract Mover class does not allow me to pick and edit different subclasses in the inspector though.
I assume plenty of people have had similar design requirements. So how do people usually solve this? Just having different MonoBehaviours for different strategies and replacing them with some other script? Or something else I'm not thinking of?
Your answer
Follow this Question
Related Questions
All inclusive getComponent call for all subclasses 1 Answer
How do declare a nonspecific class to be defined later. 1 Answer
Adding classes to objects 0 Answers
Returning gameobjects or component classes 0 Answers
How to declare variables in class derived from other class variables in the same class? 0 Answers