Esempio n. 1
0
    public void CreatePoint(JSONObject sphericalNode, JSONObject hierarchyNode)
    {
        InfoPoint  sphericalInfoPoint = InfoPoint.CreateFromJSON(sphericalNode.Print());
        InfoPoint  hierarchyInfoPoint = InfoPoint.CreateFromJSON(hierarchyNode.Print());
        GameObject pointObject        = Instantiate(pointToInstantiate, sphericalInfoPoint.position, Quaternion.identity);

        Points.Add(pointObject);
        pointObject.transform.parent = infoGraph.transform;

        pointObject.GetComponent <Point>().Id                = sphericalInfoPoint.id;
        pointObject.GetComponent <Point>().Label             = sphericalInfoPoint.label;
        pointObject.GetComponent <Point>().Type              = sphericalInfoPoint.type;
        pointObject.GetComponent <Point>().SphericalPosition = sphericalInfoPoint.position;
        pointObject.GetComponent <Point>().HierarchyPosition = hierarchyInfoPoint.position;
        sphericalPointPositions[sphericalInfoPoint.id]       = sphericalNode["position"];
        hierarchyPointPositions[hierarchyInfoPoint.id]       = hierarchyNode["position"];
    }
Esempio n. 2
0
    public void CreatePoint(JSONObject sphericalNode, JSONObject hierarchyNode)
    {
        InfoPoint  sphericalInfoPoint = InfoPoint.CreateFromJSON(sphericalNode.Print());
        InfoPoint  hierarchyInfoPoint = InfoPoint.CreateFromJSON(hierarchyNode.Print());
        GameObject pointObject        = Instantiate(pointToInstantiate, sphericalInfoPoint.position, Quaternion.identity);

        Points.Add(pointObject);
        pointObject.transform.parent        = infoGraph.transform;
        pointObject.transform.localRotation = Quaternion.Euler(new Vector3(90, 0, 0));
        pointObject.transform.GetChild(1).gameObject.transform.GetChild(0).gameObject.GetComponent <Text>().text = sphericalInfoPoint.label; // Add label to poitn text

        pointObject.GetComponent <Point>().Id                = sphericalInfoPoint.id;
        pointObject.GetComponent <Point>().Label             = sphericalInfoPoint.label;
        pointObject.GetComponent <Point>().Type              = sphericalInfoPoint.type;
        pointObject.GetComponent <Point>().SphericalPosition = sphericalInfoPoint.position;
        pointObject.GetComponent <Point>().HierarchyPosition = hierarchyInfoPoint.position;
        sphericalPointPositions[sphericalInfoPoint.id]       = sphericalNode["position"];
        hierarchyPointPositions[hierarchyInfoPoint.id]       = hierarchyNode["position"];
    }