method_get_self

使用此函数,您可以检索实例ID或struct引用,该引用是调用该方法时使用的self上下文。如果变量是不是一个方法,则函数将返回未定义。请注意,该函数还可能返回常量pointer_null,在这种情况下,在调用时正在使用当前self。

 

语法:

method_get_self(method);

参数类型描述
methodMethod要检查的方法变量。

 

返回:

Object InstanceStruct, undefined, or pointer_null

 

例子:

var _self = method_get_self(light_properties);
show_debug_message(string(_self));

上面的代码获取给定方法变量的自我上下文,并将其输出到控制台。