public void SetTerminalGates(LogicalGate terminal1, LogicalGate terminal2, int framesToWait) { this.terminal1 = terminal1; this.terminal2 = terminal2; this.framesToWait = framesToWait; gate = GetComponent<LogicalGate>(); Challenge.Instance.OnEvaluateTest += Evaluate; }
public void JoinOnTutorial(Action onJoined) { if (currentGate.IsTrue && currentGatesIndex < gatesUnlocked - 1) { currentGate.EvaluateGate(); ShowGateFinalResult(); currentGatesIndex++; currentGate = gates[currentGatesIndex]; UpdateGateValues(); SetIndicator(); onJoined(); } }
private void SetCurrentGates() { UpdgrateGatesLevel(); DestroyOldGates(); ShowTutorial(); ResetEnergyLines(); currentGatesIndex = 0; for (int i = 0; i < gatesUnlocked; i++) { Transform point = gatePositions[i]; LogicalGate gate = (LogicalGate)Instantiate(gatePrefabs[UnityEngine.Random.Range(0, gatePrefabs.Count)], point.position, point.rotation); gate.transform.SetParent(point, false); gate.SetRandomProperties(); gate.GetComponent<RectTransform>().anchoredPosition = Vector2.zero; gateNames[i].text = gate.GateName; gates[i] = gate; } currentGate = gates[currentGatesIndex]; UpdateGateValues(); ResetGateValues(); SetIndicator(); isShooting = false; }
private void Join() { if (GameManager.IsInTutorial || overhealing.isOverhealed) return; if (currentGate.IsTrue && currentGatesIndex < gatesUnlocked - 1) { currentGate.EvaluateGate(); transactionExecutor.SendGate(currentGate.GateName, currentGatesIndex + 1, currentGate.IsTrue); ShowGateFinalResult(); currentGatesIndex++; currentGate = gates[currentGatesIndex]; SetIndicator(); UpdateGateValues(); } else Overheal(); }
private void CreateGates() { int index = 0; currentGatesIndex = 0; foreach (LogicalGate prefab in gatePrefabs) { Transform point = gatePositions[index]; LogicalGate gate = (LogicalGate)Instantiate(prefab, point.position, point.rotation); gate.transform.SetParent(point, false); gate.GetComponent<RectTransform>().anchoredPosition = Vector2.zero; gateNames[index].text = gate.GateName; gate.LockGate(true); gates.Add(gate); index++; } currentGate = gates[currentGatesIndex]; currentGate.LockGate(false); UpdateGateValues(); ResetGateValues(); SetIndicator(); isShooting = false; }
public void SetGate(LogicalGate gate) { this.gate = gate; UpdateButtonValues(); }
private void SelectGate(GateChallengeIndicator indicator, LogicalGate gate) { indicator.transform.position = gate.transform.position; indicator.SetGate(gate); }