void SetBaseNode(BaseNode baseNode)
 {
     this._baseNode    = baseNode;
     this.icon.sprite  = ImageIO.GetIcon(baseNode.iconName);
     this.icon.enabled = (this.icon.sprite != null);
     this.label.text   = baseNode.title;
 }
Exemple #2
0
    public static SubNodeListPlusUnit Instantiate(GameObject prefab, GameObject parent, SubNodeParameter parameter, SubNodeListComponent subNodeComponent)
    {
        SubNodeListPlusUnit obj = Instantiate(prefab, parent.transform).GetComponent <SubNodeListPlusUnit>();

        obj.subNodeComponent = subNodeComponent;
        obj.parameter        = parameter;
        obj.icon.sprite      = ImageIO.GetIcon(obj.node.iconName);
        obj.title.text       = obj.node.title;
        return(obj);
    }
    public static SubNodeListComponentUnit Instantiate(GameObject prefab, GameObject parent, SubNodeParameter parameter)
    {
        SubNodeListComponentUnit obj = Instantiate(prefab, parent.transform).GetComponent <SubNodeListComponentUnit>();

        obj.parameter = parameter;
        if (parameter.optional)
        {
            obj.removeButtonobj.SetActive(true);
        }
        obj.title.text  = obj.node.title ?? "no title";
        obj.icon.sprite = ImageIO.GetIcon(obj.node.iconName);
        return(obj);
    }
    public static BoxPaletteMaterial Instantiate(GameObject prefab, GameObject parent, Box box)
    {
        BoxPaletteMaterial obj = Instantiate(prefab, parent.transform).GetComponent <BoxPaletteMaterial>();

        obj.icon.sprite = ImageIO.GetIcon(box.iconName);
        obj.title.text  = box.title;
        obj.tagName     = box.tag;
        Image bg = obj.GetComponent <Image>();

        if (box.color.IsPresent())
        {
            bg.color = box.color.ToColor();
        }
        else
        {
            bg.color = obj.defaultColor;
        }
        return(obj);
    }
Exemple #5
0
    public static NodeWindow Instantiate(GameObject prefab, GameObject parent, Node node)
    {
        NodeWindow obj = Instantiate(prefab, parent.transform).GetComponent <NodeWindow>();

        obj.node = node;
        if (node.color != "")
        {
            obj.SetColor(node.color);
        }
        else if (node is BaseNode)
        {
            obj.bg.color      = obj.baseNodeColor;
            obj.bgTitle.color = obj.baseNodeColor;
        }
        obj.removeButton.SetActive(node.optional);
        obj.titleText.text   = node.title;
        obj.description.text = node.text;
        obj.icon.sprite      = ImageIO.GetIcon(node.iconName);
        obj.SetComponentForParameter();
        return(obj);
    }
Exemple #6
0
    public static BoxWindow Instantiate(GameObject prefab, GameObject parent, Box box)
    {
        BoxWindow obj = Instantiate(prefab, parent.transform).GetComponent <BoxWindow>();

        obj.box = box;
        if (box.color != "")
        {
            Color c = box.color.ToColor();
            obj.defaultColor = c;
        }
        else if (box is BaseBox)
        {
            obj.defaultColor = obj.baseBoxColor;
        }
        obj.SetColor(obj.defaultColor);

        obj.removeButton.SetActive(box.optional);
        obj.titleText.text   = box.title;
        obj.description.text = box.text;
        obj.icon.sprite      = ImageIO.GetIcon(box.iconName);
        obj.SetContents();

        foreach (Box b in box.parentBox)
        {
            obj.ConnectLine(b);
        }

        obj.box.parentBox
        .ObserveAdd()
        .Subscribe(x => obj.ConnectLine(x.Value));

        obj.box.parentBox
        .ObserveRemove()
        .Subscribe(x => obj.DisconnectLine(x.Value));

        //obj.HideConnector();

        return(obj);
    }