Example #1
0
        public EditorAINode LoadLeaf(Leaf node)
        {
            EditorAILeafNode output = Node.Create(EditorAILeafNode.ID, Vector3.zero) as EditorAILeafNode;

            output.dataType = node.GetType().ToString();
            output.data     = new GenericSerializable(output.dataType);
            output.data.SetObject(node, nodeTypes);
            return(output);
        }
Example #2
0
 private void AddNode(Type type, Vector2 position)
 {
     if (type.IsSubclassOf(typeof(Leaf)))
     {
         EditorAILeafNode node = Node.Create(EditorAILeafNode.ID, position) as EditorAILeafNode;
         node.Init(type);
     }
     else if (type.IsSubclassOf(typeof(Decorator)))
     {
         EditorAIDecoratorNode node = Node.Create(EditorAIDecoratorNode.ID, position) as EditorAIDecoratorNode;
         node.Init(type);
     }
     else if (type.IsSubclassOf(typeof(Combinational)))
     {
         EditorAICombinationalNode node = Node.Create(EditorAICombinationalNode.ID, position) as EditorAICombinationalNode;
         node.Init(type);
     }
 }