runscene和loadscene区别,runscene设计目的是干什么的,是不是和loadscene重复了。

runScene
运行指定场景。
meta description
定义于 cocos2d/core/CCDirector.js:495
参数列表
scene Scene | SceneAsset The need run scene.
onBeforeLoadScene Function The function invoked at the scene before loading.
onLaunched Function The function invoked at the scene after launch.
loadScene
通过场景名称进行加载场景。
meta description
返回 Boolean
定义于 cocos2d/core/CCDirector.js:519
参数列表
sceneName String The name of the scene to load.
onLaunched Function callback, will be called after scene launched.
官方以前好像解释过,runScene主要是以前的cocos2dx带过来的,建议直接用loadScene
参数不一样,可以推断loadScene内部调用了loadResources,然后再调用的runScene。具体是不是可以去cocos引擎安装目录看内核源码。
runscene通过scene对象或者sceneAsset对象切换到指定场景;loadScene通过场景名切换到指定场景,loadScene内部会通过场景名,找到对应bundle,从bundle中加载资源(对应runScene里的sceneAsset对象)。
看你解释用loadScene更合理。