void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == "Comparison") { if (!FCCBox.isComplete) { comparisonBoxCollider = collider; comparisonBox = collider.GetComponent<ComparisonBox>(); } } if (collider.tag == "MouseDetector") { if (comparisonBox != null) { if (comparisonBox.pressed) { attachCollider(); } } } }
public void setComparison(GameObject comparisonObject) { comparisonBoxCollider = comparisonObject.GetComponent<Collider2D>(); comparisonBox = comparisonObject.GetComponent<ComparisonBox>(); }