I am writing a game in Unity, and I am trying to use polymorphism to access 2 subclasses but keep getting an error:
Can not cast from source type to destination type
I have a serialized list of Places
, and I am trying to downcast to a Property
, which is a subclass of Place
. How am I able to do this in Unity?
((Property)Board.GetBoardPlace(Players[PlayerTurn].Position)).Owner = Players[PlayerTurn];