Exemplo n.º 1
0
    private void UpdateWiresFromConnectionList()
    {
        DeleteOldWires();
        foreach (int[] connection in connectionList)
        {
            if (connection.Length != 2)
            {
                return;
            }

            int outputIndex = connection[0];
            int inputIndex  = connection[1];

            if (hackNodes.ElementAtOrDefault(connection[0]) == null || hackNodes[connection[0]] == null)
            {
                return;
            }
            if (hackNodes.ElementAtOrDefault(connection[1]) == null || hackNodes[connection[1]] == null)
            {
                return;
            }

            GUI_HackingNode outputUINode = GetUIComponentOfNode(hackNodes[outputIndex]);
            GUI_HackingNode inputUINode  = GetUIComponentOfNode(hackNodes[inputIndex]);

            GameObject      connectingWire = Instantiate(connectingWireUIPrefab, transform);
            GUI_HackingWire GUIWire        = connectingWire.GetComponent <GUI_HackingWire>();
            GUIWire.SetStartUINode(outputUINode);
            GUIWire.SetEndUINode(inputUINode);
            GUIWire.PositionWireBody();

            hackingWires.Add(GUIWire);
        }
    }
Exemplo n.º 2
0
    private void GenerateNodeConnections()
    {
        foreach (HackingNode node in outputNodes)
        {
            foreach (HackingNode subNode in node.ConnectedInputNodes)
            {
                GUI_HackingNode outputUINode = GetUIComponentOfNode(node);
                GUI_HackingNode inputUINode  = GetUIComponentOfNode(subNode);

                GameObject      connectingWire = Instantiate(connectingWireUIPrefab, transform);
                GUI_HackingWire GUIWire        = connectingWire.GetComponent <GUI_HackingWire>();
                GUIWire.SetStartUINode(outputUINode);
                GUIWire.SetEndUINode(inputUINode);
                GUIWire.PositionWireBody();

                hackingWires.Add(GUIWire);
            }
        }
    }
Exemplo n.º 3
0
    private void UpdateWiresFromConnectionList()
    {
        DeleteOldWires();
        foreach (int[] connection in connectionList)
        {
            int             outputIndex  = connection[0];
            int             inputIndex   = connection[1];
            GUI_HackingNode outputUINode = GetUIComponentOfNode(hackNodes[outputIndex]);
            GUI_HackingNode inputUINode  = GetUIComponentOfNode(hackNodes[inputIndex]);

            GameObject      connectingWire = Instantiate(connectingWireUIPrefab, transform);
            GUI_HackingWire GUIWire        = connectingWire.GetComponent <GUI_HackingWire>();
            GUIWire.SetStartUINode(outputUINode);
            GUIWire.SetEndUINode(inputUINode);
            GUIWire.PositionWireBody();

            hackingWires.Add(GUIWire);
        }
    }