使用此函数,您可以检索实例ID或struct引用,该引用是调用该方法时使用的self上下文。如果变量是不是一个方法,则函数将返回未定义。请注意,该函数还可能返回常量pointer_null,在这种情况下,在调用时正在使用当前self。
method_get_self(method);
参数 | 类型 | 描述 |
---|---|---|
method | Method | 要检查的方法变量。 |
Object Instance, Struct, undefined, or pointer_null
var _self = method_get_self(light_properties);
show_debug_message(string(_self));
上面的代码获取给定方法变量的自我上下文,并将其输出到控制台。