Sample Game Plugin
The SampleGamePlugin demonstrates the basics of how to build a custom plugin for game code that can run both in a stand-alone application (such as ezPlayer) as well as inside the editor.
The project is only available when the solution is built with EZ_BUILD_SAMPLES activated.
The SampleGameState class shows how to implement a simple game state that adds high-level game logic, such as handling a game UI. See
ezGameApplication for further details.
DemoComponentshows how to modify the transform of an object dynamically.
DebugRenderComponentshows how to use debug rendering.
For further details also see
Under Data/Samples/SampleGame you will find an editor project which uses the
SampleGamePlugin. Note that the project references the plugin as a runtime plugin (under Editor > Project Settings > Engine Plugins). This makes the custom components available to the editor.
When you press ‘Play’ in the editor, the scene will be simulated and the custom components, such as the
DemoComponent, will take effect.
When you press ‘Play the Game’ a full game window is launched and now even the custom game state is instantiated and executed. Consequently, the UI will appear and you can interact with it. Note that this still runs inside the editor process.
You can also export and run the scene externally in the stand-alone ezPlayer application.