コード例 #1
0
    //public void Start () {

    //}

    public void makeNewAttributeNode()
    {
        GameObject       newNode      = (GameObject)Instantiate(attributePrefab);
        SetAttributeNode nodeSettings = newNode.GetComponent <SetAttributeNode>();

        nodeSettings.setUpNode(lineCam, 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);
    }
コード例 #2
0
    public GameObject newAttributeNode(XmlNode node, GameObject connectToNode, int xCoord, int yCoord)        //Returns the out port of that node it makes
    //Debug.Log("Attribute Node: " + node.Name + " X Coord: " + xCoord + " Y Coord : " + yCoord);
    {
        GameObject       newNode      = (GameObject)Instantiate(attributePrefab);
        SetAttributeNode nodeSettings = newNode.GetComponent <SetAttributeNode>();

        nodeSettings.setUpNode(lineCam, connectCallObject);
        if (connectToNode != null)
        {
            nodeSettings.setInConnection(connectToNode);
        }
        nodeSettings.extractAttributes(node);

        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);
        return(nodeSettings.outPort);
    }