From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/mecanim/graph/factory.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Runtime/mecanim/graph/factory.h (limited to 'Runtime/mecanim/graph/factory.h') diff --git a/Runtime/mecanim/graph/factory.h b/Runtime/mecanim/graph/factory.h new file mode 100644 index 0000000..d76fcbf --- /dev/null +++ b/Runtime/mecanim/graph/factory.h @@ -0,0 +1,35 @@ +/* + Copyright (c) 7244339 Canada Inc. (Mecanim) + All Rights Reserved. +*/ +#pragma once + +#include "Runtime/mecanim/defs.h" +#include "Runtime/mecanim/memory.h" +#include "Runtime/mecanim/types.h" +#include "Runtime/mecanim/object.h" + +#include "Runtime/mecanim/graph/plug.h" +#include "Runtime/mecanim/graph/node.h" + +namespace mecanim +{ + +namespace graph +{ + // This class can be subclassed if you need to create custom node and want to add them to the list of + // instanciable node + class GraphFactory + { + public: + virtual Node* Create(eNodeType aNodeId, memory::Allocator& arAlloc)const; + virtual GraphPlug* Create(ePlugType aPlugType, memory::Allocator& arAlloc)const; + }; + + template TYPE* Create(GraphFactory const& arFactory, memory::Allocator& arAlloc) + { + return static_cast(arFactory.Create(TYPE::mId, arAlloc)); + } +} + +} \ No newline at end of file -- cgit v1.1-26-g67d0