Node类虚方法

void _enter_tree() virtual
void _enter_tree() virtual

String _get_configuration_warning() virtual

void _input(event: InputEvent) virtual
void _input(event: InputEvent) virtual

void _process(delta: float) virtual
void _physics_process(delta: float) virtual

void _ready() virtual


Godot引擎对这些特殊的方法的运行规则

首先它们有个特点,就是我们不能控制它们具体的运行时间。

派生类继承基类的虚方法,重写后,Godot引擎会自动对其做多态的处理。
当使用脚本新建脚本类,派生类中的_ready()不能彻底覆盖基类中的虚方法。
其运行顺序为先运行基类的_ready()再运行派生类的_ready()。先运行派生类的_physics_process()再运行基类的_physics_process()。

·

最后修改:2020 年 04 月 13 日
如果觉得我的文章对你有用,请随意赞赏