コード例 #1
0
    public void Register()
    {
        registeredGates.Add(startConnectionPoint.logicGate);

        Vector3 startPos = startConnectionPoint.transform.position;

        foreach (Tuple <ConnectionPoint, LineRenderer> tuple in endConnectionPoints)
        {
            LineRenderer    lineRenderer    = tuple.Item2;
            ConnectionPoint connectionPoint = tuple.Item1;
            Vector3         endPos          = connectionPoint.transform.position;
            Vector3         middlePoint     = new Vector3(startPos.x, endPos.y);
            Vector3[]       pos             = { startPos, middlePoint, endPos };
            lineRenderer.SetPositions(pos);
            lineRenderer.enabled = true;

            registeredGates.Add(tuple.Item1.logicGate);
            tuple.Item1.RegisterWire(this);
        }
        startConnectionPoint.RegisterWire(this);
        render = true;
        UpdateSignal();
    }