示例#1
0
    public static NodeGraphicScript CreateGraphic(NodeScript node, Vector3 position, float radius)
    {
        // XXX: Collision checking for finding position
        Vector3 pos = position + UnityEngine.Random.onUnitSphere * radius;

        // XXX: Spawn far away (in param) and MoveTo position
        GameObject newNode;

        newNode = GameObject.Instantiate(nodePrefab, pos, Quaternion.identity, gameObject.transform) as GameObject;
        newNode.SetActive(true);
        NodeGraphicScript script = newNode.GetComponent <NodeGraphicScript>();

        script.Init(node);
        nodes.Add(node.GetAddress(), script);

        return(script);
    }
示例#2
0
 public static bool NodeIsVisible(NodeScript node)
 {
     return(NodeIsVisible(node.GetAddress()));
 }
示例#3
0
 public static NodeGraphicScript GetGraphic(NodeScript node)
 {
     return(nodes[node.GetAddress()]);
 }
示例#4
0
 public static NodeGraphicScript DisplayNode(Vector3 position, NodeScript node)
 {
     return(DisplayNode(position, node.GetAddress()));
 }