Skip to content

Commit

Permalink
Connectors keep track of who they match with
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelCS-Aula committed Jan 8, 2021
1 parent 376ffea commit 39f61b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Assets/Scripts/ArenaPiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ public bool IsFull()
choosenCombo.chosenOther.isUsed = true;
choosenCombo.chosenMine.isUsed = true;

choosenCombo.chosenMine.myMatch = choosenCombo.chosenOther;
choosenCombo.chosenOther.myMatch = choosenCombo.chosenMine;

Transform trn = TransformPiece(choosenCombo.chosenMine,
choosenCombo.chosenOther, other, pieceDistance);

Expand Down
3 changes: 2 additions & 1 deletion Assets/Scripts/Connector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public class Connector : MonoBehaviour, IComparable<Connector>
[SerializeField] public ConnectorColor color;
public Vector3 heading => transform.forward;


[ReadOnly]
public Connector myMatch = null;
[HideInInspector] public bool isUsed = false;

public int pins = 0;
Expand Down

0 comments on commit 39f61b1

Please sign in to comment.