Esempio n. 1
0
    public void makeNewDataNode()
    {
        GameObject  newNode      = (GameObject)Instantiate(dataPrefab);
        SetDataNode nodeSettings = newNode.GetComponent <SetDataNode>();

        nodeSettings.setUpNode(connectCallObject);
        nodeSettings.setEnlosingType(enclosingTypeSetter);
        newNode.transform.SetParent(worldCanvas.transform, false);
        newNode.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width / 2f, Screen.height / 2f, 0));
        allNodes.Add(newNode);
    }
Esempio n. 2
0
    public void newDataNode(XmlNode node, GameObject connectToNode, int xCoord, int yCoord)
    {
        //Debug.Log("Data Node: " + node.Name + " X Coord: " + xCoord + " Y Coord : " + yCoord);
        GameObject  newNode      = (GameObject)Instantiate(dataPrefab);
        SetDataNode nodeSettings = newNode.GetComponent <SetDataNode>();

        nodeSettings.setUpNode(connectCallObject);
        if (connectToNode != null)
        {
            nodeSettings.setInConnection(connectToNode);
        }
        nodeSettings.setEnlosingType(node.Name);
        nodeSettings.setData(node.InnerXml);
        newNode.transform.SetParent(worldCanvas.transform, false);

        newNode.transform.position  = new Vector3(550f * xCoord, 150f * yCoord, 0f);
        newNode.transform.position += gameObject.transform.position;

        connectToNode.GetComponent <BranchPort>().branches.Add(nodeSettings.inPort);
        allNodes.Add(newNode);
    }