SceneManager函数重命名
This commit is contained in:
		
							parent
							
								
									284db32f6d
								
							
						
					
					
						commit
						2dfa2b3f07
					
				|  | @ -34,7 +34,7 @@ e2d::SceneManager::~SceneManager() | |||
| { | ||||
| } | ||||
| 
 | ||||
| void e2d::SceneManager::enter(Scene * scene, Transition * transition /* = nullptr */, bool saveCurrentScene /* = true */) | ||||
| void e2d::SceneManager::push(Scene * scene, Transition * transition /* = nullptr */, bool saveCurrentScene /* = true */) | ||||
| { | ||||
| 	if (!scene) | ||||
| 		return; | ||||
|  | @ -63,11 +63,14 @@ void e2d::SceneManager::enter(Scene * scene, Transition * transition /* = nullpt | |||
| 	} | ||||
| } | ||||
| 
 | ||||
| void e2d::SceneManager::back(Transition * transition /* = nullptr */) | ||||
| void e2d::SceneManager::pop(Transition * transition /* = nullptr */) | ||||
| { | ||||
| 	// 栈为空时,调用返回场景函数失败
 | ||||
| 	WARN_IF(_scenes.size() == 0, "Scene stack is empty!"); | ||||
| 	if (_scenes.size() == 0) return; | ||||
| 	if (_scenes.size() == 0) | ||||
| 	{ | ||||
| 		WARN("Scene stack is empty!"); | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	// 从栈顶取出场景指针,作为下一场景
 | ||||
| 	_nextScene = _scenes.top(); | ||||
|  |  | |||
|  | @ -22,15 +22,15 @@ public: | |||
| 	// 销毁实例
 | ||||
| 	static void destroyInstance(); | ||||
| 
 | ||||
| 	// 切换场景
 | ||||
| 	void enter( | ||||
| 	// 场景入栈
 | ||||
| 	void push( | ||||
| 		Scene * scene,						/* 下一个场景的指针 */ | ||||
| 		Transition * transition = nullptr,	/* 场景切换动作 */ | ||||
| 		bool saveCurrentScene = true		/* 是否保存当前场景 */ | ||||
| 	); | ||||
| 
 | ||||
| 	// 返回上一场景
 | ||||
| 	void back( | ||||
| 	// 场景出栈
 | ||||
| 	void pop( | ||||
| 		Transition * transition = nullptr	/* 场景切换动作 */ | ||||
| 	); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue