Add Music fluctuations project and Chinese plan docs

This commit is contained in:
2026-03-21 15:55:54 +08:00
parent 629455df07
commit a172d75e36
462 changed files with 382904 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
#include"SceneManager.h"
#include"Scene.h"
SceneManager::SceneManager(){}
SceneManager::~SceneManager(){}
void SceneManager::ChangeScene(Scene* p_nextScene)
{
if (p_nextScene == nullptr) { return; }
if (m_currentScene != nullptr)
{
p_nextScene->m_context = m_currentScene->m_context;
m_currentScene->OnExit();
}
p_nextScene->OnEnter();
m_currentScene = p_nextScene;
}
void SceneManager::ChangeScene(std::string p_name)
{
if (Scene* scene = GetScene(p_name); scene)
ChangeScene(scene);
}
void SceneManager::RegisterScene(std::string p_name, Scene* p_scene)
{
if (m_scenes.find(p_name) == m_scenes.end())
m_scenes[p_name] = p_scene;
}
Scene* SceneManager::GetScene(std::string p_name)
{
if (m_scenes.find(p_name) != m_scenes.end())
return m_scenes[p_name];
return NULL;
}