Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
PhysicsServer2DManager¶
继承: Object
用于管理 PhysicsServer2D 实现的单例。
描述¶
PhysicsServer2DManager 是用于注册 PhysicsServer2D 实现、设置默认实现的 API。
注意:无法在运行时切换物理服务器。这个类只在启动时在服务器初始化级别使用,可能由 Godot 本身使用,也可能由 GDExtension 使用。
方法¶
void |
register_server ( String name, Callable create_callback ) |
void |
set_default_server ( String name, int priority ) |
方法说明¶
void register_server ( String name, Callable create_callback )
注册 PhysicsServer2D 实现,传入名称 name
和返回 PhysicsServer2D 对象的 Callable。
void set_default_server ( String name, int priority )
如果优先级 priority
比当前默认实现的优先级高,则将由名称 name
标识的 PhysicsServer2D 实现设置为默认实现。