Raise error if Resource is of wrong type as function argument
This commit is contained in:
parent
0582cefcbb
commit
a2c419bdc9
|
@ -122,6 +122,18 @@ struct VariantObjectClassChecker {
|
|||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class Ref;
|
||||
|
||||
template <typename T>
|
||||
struct VariantObjectClassChecker<const Ref<T> &> {
|
||||
static _FORCE_INLINE_ bool check(const Variant &p_variant) {
|
||||
Object *obj = p_variant;
|
||||
const Ref<T> node = p_variant;
|
||||
return node.ptr() || !obj;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantObjectClassChecker<Node *> {
|
||||
static _FORCE_INLINE_ bool check(const Variant &p_variant) {
|
||||
|
|
Loading…
Reference in New Issue