public void ActivateHadrona(Hadrona hadrona) { for (int i = 0; i < hadronas.Count; i++) { if (hadronas[i].Equals(hadrona)) { hadronas[i].Select(); currentHadrona = i; } } }
private void OnTriggerEnter2D(Collider2D other) { if (!finished && other.CompareTag("Player")) { Hadrona hadrona = other.GetComponent <Hadrona>(); if (this.hadrona is null || hadrona.Equals(this.hadrona)) { ActiveHadronaManager.Instance.DeleteHadrona(); finished = true; audioSource.Play(); } } }
public static void UndoMove() { if (moveOrder.Count == 0) { return; } Hadrona h = moveOrder.Pop(); if (h.moves.Count == 0) { return; } h.Select(); Vector3Int cellPos = h.obstacles.WorldToCell(h.transform.position); Vector3Int movement = h.moves.Pop() - cellPos; h.obstacles.SetTile(cellPos, null); h.transform.Translate((Vector3)movement * h.step); }
public void UndoMove() { Hadrona.UndoMove(); }