Exemplo n.º 1
0
        public SharpNoise.Modules.Module InstantiateGenericModule(Data.NodeData nodeData)
        {
            //Create instance of selected node type
            SharpNoise.Modules.Module module = (SharpNoise.Modules.Module)Activator.CreateInstance(Type.GetType(nodeData.moduleType));
            module.SetData(nodeData);

            return(module);
        }
Exemplo n.º 2
0
        public virtual void SetData(Data.NodeData data)
        {
            name = data.name;
            id   = data.id;
            windowRect.position = data.windowPosition;
            showValues          = data.showValues;

            //Set view
            if (data.isPerspective)
            {
                TogglePerspective();
            }
        }
Exemplo n.º 3
0
        //Used when loading nodes from saved data
        public void InstantiateGenericNode(Data.NodeData nodeData)
        {
            if (nodes == null)
            {
                nodes = new List <Node>();
            }

            //Create instance of selected node type
            Node node = (Node)Activator.CreateInstance(Type.GetType(nodeData.type), Manager.Instance.scene, EventManager.Instance.mousePosition);

            node.SetData(nodeData);
            node.BuildConnectionPoints();

            nodes.Add(node);
        }