Example #1
0
    //[NODE RELATED]
    void createNewNode(Vector3 pos)
    {
        GameObject   curNode     = Instantiate(genericNode, pos, Quaternion.identity, gameObject.transform);
        NodeIdentity curIdentity = curNode.GetComponent <NodeIdentity>();

        curNode.transform.position = new Vector3(curNode.transform.position.x, curNode.transform.position.y, 0);
        string nodeId = randomString(8);

        while (nodes.ContainsKey(nodeId))
        {
            nodeId = randomString(8);
        }
        curIdentity.setID(nodeId);
        nodes.Add(nodeId, curIdentity);
    }