Exemple #1
0
    //Working
    public void ConnectToParentNonRec(GameObject otherElement)
    {
        CircuitElement parent = gameObject.GetComponentInParent <CircuitElement> ();

        if (parent != null)
        {
            if (LeftEdge)
            {
                parent.ConnectToLeft(otherElement);
            }
            else
            {
                parent.ConnectToRight(otherElement);
            }
            Snap(otherElement.transform.position);
            edgeCollider.enabled = false;
        }
        else
        {
            Debug.LogWarning("Found an edge circle without parent<CircuitElement>");
        }
    }
Exemple #2
0
    //Working
    public void ConnectToParent(GameObject otherElement)
    {
        CircuitElement parent = gameObject.GetComponentInParent <CircuitElement> ();

        if (parent != null)
        {
            if (LeftEdge)
            {
                parent.ConnectToLeft(otherElement);
            }
            else
            {
                parent.ConnectToRight(otherElement);
            }
            otherElement.GetComponent <EdgeHandler>().ConnectToParentNonRec(gameObject);
            edgeGFX.color        = Color.red;
            edgeCollider.enabled = false;
        }
        else
        {
            Debug.LogWarning("Found an edge circle without parent<CircuitElement>");
        }
    }