schola.core.unreal_connections.StandaloneUnrealConnection
class schola.core.unreal_connections.StandaloneUnrealConnection(url, executable_path, headless_mode, port=None, map=None, display_logs=True, set_fps=None, disable_script=False) : Bases: UnrealConnection
一个独立的连接,启动时会启动一个 Unreal Engine 实例。
Parameters: : - url (str) – 连接的 URL
- ue_path (str) – Unreal Engine 可执行文件的路径
- headless_mode (bool) – 是否以无头模式运行
- port (int, optional) – 连接的端口,如果为 None,则会找到一个开放的端口
- map (str, optional) – 要加载的地图。默认为 Unreal Engine 项目中的默认地图
- display_logs (bool, default=True) – 是否显示日志
- set_fps (int, optional) – 运行时使用固定的帧率,如果为 None,则不使用固定时间步长
- disable_script (bool, default=False) – 是否禁用 Unreal Engine Schola 插件中的自动启动脚本设置
- executable_path (str)
executable_path : Unreal Engine 可执行文件的路径
Type: : str
headless_mode : 是否以无头模式运行
Type: : bool
display_logs : 是否显示日志
Type: : bool
set_fps : 运行时使用固定的帧率,如果为 None,则不使用固定时间步长
Type: : int
env_process : 运行 Unreal Engine 的进程。如果进程未运行,则为 None
Type: : subprocess.Popen, optional
disable_script : 是否禁用 Unreal Engine Schola 插件中的自动启动脚本设置
Type: : bool
map : 要加载的地图。默认为 Unreal Engine 项目中的默认地图
Type: : str
tcp_socket : 绑定到开放端口的套接字对象。如果提供了端口,并且我们不需要打开新端口,则为 None
Type: : socket.socket, optional
方法
__init__(url, executable_path, headless_mode) | |
close() | 关闭与 Unreal Engine 的连接。 |
connect_stubs(*stubs) | 将 gRPC stubs 连接到 Unreal Engine 通道 |
get_open_port(url) | 获取给定 URL 上的开放端口 |
make_args() | 生成提供给 Unreal Engine 可执行文件的参数。 |
start() | 启动 Unreal Engine 进程。 |
属性
address | 返回连接地址 |
is_active | 返回连接是否处于活动状态 |
__init__(url, executable_path, headless_mode, port=None, map=None, display_logs=True, set_fps=None, disable_script=False) : Parameters: : - url (str)
- executable_path (str)
- headless_mode (bool)
- port (int | None)
- map (str | None)
- display_logs (bool)
- set_fps (int | None)
- disable_script (bool)
close() : 关闭与 Unreal Engine 的连接。如果 Unreal Engine 进程正在运行,则会将其终止。
返回类型: : None
property is_active*: bool* : 返回连接是否处于活动状态
Returns: : 连接是否处于活动状态
Return type: : bool
make_args() : 生成提供给 Unreal Engine 可执行文件的参数。
Returns: : 要提供给 Unreal Engine 可执行文件的参数
Return type: : List[str]
start() : 启动 Unreal Engine 进程。
Raises: : Exception – 如果子进程已在运行
返回类型: : None