From c5199a2fbf619249611cbf62d8e122eec9c1a825 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 12 Apr 2019 13:54:28 +0200 Subject: [PATCH] Add a type conversion to Variant for anything that supports ___get_from_variant() --- include/core/Variant.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/core/Variant.hpp b/include/core/Variant.hpp index 310bd41b..5f400135 100644 --- a/include/core/Variant.hpp +++ b/include/core/Variant.hpp @@ -226,6 +226,7 @@ public: operator NodePath() const; operator RID() const; operator godot_object *() const; + template operator T*() const { return static_cast(T::___get_from_variant(*this)); } operator Dictionary() const; operator Array() const;