Make the Prepare and Destroy step more customizable.
This commit is contained in:
parent
250600d8b2
commit
63bb31e728
5 changed files with 20 additions and 5 deletions
|
@ -60,7 +60,7 @@ namespace cloonel {
|
|||
|
||||
///--------------------------------------------------------------------------
|
||||
///--------------------------------------------------------------------------
|
||||
void GameplaySceneClassic::Prepare() {
|
||||
void GameplaySceneClassic::OnPrepare() {
|
||||
const float halfRefHeight = static_cast<float>(REFERENCE_HEIGHT) / 2.0f;
|
||||
|
||||
std::unique_ptr<MoverSine> moverSine(new MoverSine());
|
||||
|
@ -101,6 +101,8 @@ namespace cloonel {
|
|||
///--------------------------------------------------------------------------
|
||||
///--------------------------------------------------------------------------
|
||||
void GameplaySceneClassic::Destroy() noexcept {
|
||||
GameplayScene::Destroy();
|
||||
|
||||
//Destroy in reverse creation order
|
||||
m_platforms = std::move(std::unique_ptr<PlatformSystem>(nullptr));
|
||||
m_wallpaper = std::move(std::unique_ptr<TiledWallpaper>(nullptr));
|
||||
|
@ -108,6 +110,7 @@ namespace cloonel {
|
|||
m_moverLeftRight = std::move(std::unique_ptr<MoverLeftRight>(nullptr));
|
||||
m_player = std::move(std::unique_ptr<Character>(nullptr));
|
||||
m_moverSine = std::move(std::unique_ptr<MoverSine>(nullptr));
|
||||
|
||||
}
|
||||
|
||||
///--------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue