1
0
mirror of https://projects.caleb-brown.dev/UDRI-XRT/UDRIGEEKCup2024.git synced 2025-01-22 07:08:51 -05:00

Fixed stroke counter not updating

This commit is contained in:
Abraham 2024-04-16 09:31:29 -04:00
parent 3a5f9ea5a3
commit a67e679f2c
2 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,7 @@ namespace GolfControls
{
public class StrokeCounter : MonoBehaviour
{
public BoolVariable ballMovingVariable;
public IntVariable StrokeVariable;
public VoidEvent HitEvent;
@ -21,7 +22,8 @@ namespace GolfControls
private void OnHit()
{
StrokeVariable.SetValue(StrokeVariable.Value++);
if (ballMovingVariable.Value) return;
StrokeVariable.SetValue(StrokeVariable.Value+1);
}
}
}

View File

@ -3986,6 +3986,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 594dbcb0ac6fee442ac8e47c96781542, type: 3}
m_Name:
m_EditorClassIdentifier:
ballMovingVariable: {fileID: 11400000, guid: 838a13f5fd312c94398e49cfc36e34ad, type: 2}
StrokeVariable: {fileID: 11400000, guid: b17566f4d19813249a993793ac86d94c, type: 2}
HitEvent: {fileID: 11400000, guid: 90fa28c269919df41acdd37835ee3b9e, type: 2}
--- !u!222 &8141010434514370326