BlandLife
Building Constructors 101
Not to familiar with C# personally but I'm using it with Unity for a project-based class I'm taking. I'm trying to build a state machine, where there's the
BaseState
interface and StateMachine
class. In my StateMachine
class I have a constructor that takes a BaseState defaultState
parameter. I want it to be able to take classes that implement/inherit from the BaseState
interface like IdleState
or PatrolState
, but I really don't have a clue how to do that.102 replies