Scene

类位于 Infernux

描述

运行时场景,包含 GameObject 层级。

description

属性

名称 类型 描述
name str 场景名称。
structure_version int (只读)
main_camera Optional[Camera]

properties

公共方法

方法 描述
set_playing(playing: bool) → None
create_game_object(name: str = 'GameObject') → GameObject
create_primitive(type: PrimitiveType, name: str = '') → GameObject
create_from_model(guid: str, name: str = '') → Optional[GameObject]
get_root_objects() → List[GameObject]
get_all_objects() → List[GameObject]
find(name: str) → Optional[GameObject]
find_by_id(id: int) → Optional[GameObject]
find_object_by_id(id: int) → Optional[GameObject]
find_with_tag(tag: str) → Optional[GameObject]
find_game_objects_with_tag(tag: str) → List[GameObject]
find_game_objects_in_layer(layer: int) → List[GameObject]
destroy_game_object(game_object: GameObject) → None
instantiate_game_object(source: GameObject, parent: Optional[GameObject] = None) → Optional[GameObject]
instantiate_from_json(json_str: str, parent: Optional[GameObject] = None) → Optional[GameObject]
process_pending_destroys() → None
is_playing() → bool
awake_object(game_object: GameObject) → None
serialize() → str
deserialize(json_str: str) → None
save_to_file(path: str) → None
load_from_file(path: str) → None
has_pending_py_components() → bool
take_pending_py_components() → List[PendingPyComponent]

public_methods

生命周期方法

方法 描述
start() → None

lifecycle_methods

示例

example

# TODO: Add example for Scene

另请参阅

see_also