Ejemplo n.º 1
0
 public void ActivateHadrona(Hadrona hadrona)
 {
     for (int i = 0; i < hadronas.Count; i++)
     {
         if (hadronas[i].Equals(hadrona))
         {
             hadronas[i].Select();
             currentHadrona = i;
         }
     }
 }
Ejemplo n.º 2
0
 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();
         }
     }
 }
Ejemplo n.º 3
0
    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);
    }
Ejemplo n.º 4
0
 public void UndoMove()
 {
     Hadrona.UndoMove();
 }