freezy / VisualPinball.Engine

:video_game: Visual Pinball Engine for Unity
https://docs.visualpinball.org
GNU General Public License v3.0
396 stars 62 forks source link

Add serialized subclasses #470

Open arthurkehrwald opened 1 month ago

arthurkehrwald commented 1 month ago

This commit caused _id and some other properties of the classes GameLogicEngineCoil, GameLogicEngineSwitch and GameLogicEngineLamp to not be serialized by Unity, which led to this issue in the VisualPinball.Engine.Mpf repository. This pull request adds new subclasses of the classes in question which implement Unity's ISerializationCallbackReceiver interface to serialize their properties without making them public again and without introducing a dependency on Unity to the core VisualPinball.Engine project. These new classes are used in this pull request to fix the aforementioned issue.