类型 函数 库 composer.* 返回值 无 修订 版本 2024.3703 关键词 composer, 场景, 移除, removeHidden 另请参阅 composer.removeScene()
此函数将移除(或可选地回收)除当前活动场景之外的所有场景。首先会向所有这些场景派发一个 destroy 事件。
要回收场景而不是完全移除它们,您可以将 shouldRecycle
参数设置为 true
— 这意味着每个场景的 self.view
显示组将被移除,但它们的场景对象将保留在内存中。如果省略 shouldRecycle
或将其设置为 false
(默认值),则将完全移除场景,包括其场景对象。
composer.removeHidden( [shouldRecycle] )
布尔值。 如果应该回收场景而不是完全移除,请将此参数设置为 true
。默认为 false
。
-- Completely removes all scenes except for the currently active scene composer.removeHidden()
-- Recycles all scenes except for the currently active scene composer.removeHidden( true )