public void ClearConnection() { if (sendingTo != null) { sendingTo.ClearLine(); if (sendingTo.receivingFrom != null) { sendingTo.ClearLine(); } sendingTo = null; } }
public void UpdateGateType() { switch (dropdown.value) { case 0: gateType = GateType.And; iconRendere.sprite = and; break; case 1: gateType = GateType.Or; iconRendere.sprite = or; break; case 2: gateType = GateType.Not; iconRendere.sprite = not; break; } if (gateType == GateType.Not) { if (input2.receivingFrom != null) { input2.receivingFrom.ClearConnection(); } input2.ClearLine(); input2.gameObject.SetActive(false); input1.transform.localPosition = new Vector3(input1.transform.localPosition.x, 0, input1.transform.localPosition.z); } else { input2.gameObject.SetActive(true); input1.transform.localPosition = new Vector3(input1.transform.localPosition.x, 0.276f, input1.transform.localPosition.z); } }