Hi, I am new to Unity and I have been writing scripts that inherit each other, but in a way that I think is bad, and I was wondering if I could do it in another way.
Over here, I need the PlayerControl Class to inherit SpeedBoost, but I also need MonoBehaviour as well
in both of the classes, and since I can’t have it in both of the classes, I have to create a loop.
And here, I need the DisplayRPM class to only be inherited to PlayerControl, but I have to inherit a few other classes to lastly get to the MonoBehaviour class.
Here as well, I only need the GenerateObstacles class to be inherited to PlayerControl
And it goes on into a loop, until I finally get to the class that inherits MonoBehaviour, the one I need in all of the classes.
Now, the question is: Is there any way I could inherit MonoBehaviour in all of the classes, without having to inherit each class into the other one, just to finally get to MonoBehaviour?
So, to wrap things up: I need for the classes to be inherited to PlayerControl only, but not between each other, but at the same time I need to use MonoBehaviour in all of them, which gives me the error.