public void SetSelectableColumn(GateChallengeIndicator indicator) { indicator.transform.SetParent(transform); indicator.transform.SetAsFirstSibling(); for (int i = 0; i < gates.Count; i++) { Button button = gates[i].gameObject.AddComponent<Button>(); button.onClick.AddListener(() => { SelectGate(indicator, button.gameObject.GetComponent<LogicalGate>()); }); button.transition = Selectable.Transition.None; if (i == 0) button.onClick.Invoke(); } Challenge.Instance.OnEvaluateTest += EvaluateGates; }
private void SelectGate(GateChallengeIndicator indicator, LogicalGate gate) { indicator.transform.position = gate.transform.position; indicator.SetGate(gate); }