Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "1.2.5",
"commands": [
"csharpier"
]
}
}
}
18 changes: 18 additions & 0 deletions .github/workflows/csharpier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check Style
on:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
check_formatting:
runs-on: ubuntu-slim
name: Run csharpier
steps:

- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
- run: |
dotnet tool restore
dotnet csharpier check .
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: local
hooks:
- id: dotnet-tool-restore
name: Install .NET tools
entry: dotnet tool restore
# for pre-commit < 4.4.0 use language: system
language: unsupported
always_run: true
pass_filenames: false
stages:
- commit
- push
- post-checkout
- post-rewrite
description: Install the .NET tools listed at .config/dotnet-tools.json.
- id: csharpier
name: Run CSharpier on C# files
entry: dotnet tool run CSharpier format .
language: system
types:
- c#
description: CSharpier is an opinionated C# formatter inspired by Prettier.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@ You may need to [download the drivers](https://www.gaming.tobii.com/getstarted/)

Documentation for each mini-game is provided under [`docs/`](/docs/), focusing on how to edit important values during play testing.

## Developing

We use [CSharpier](https://csharpier.com/) to enforce code style on pull requests.
To help with formatting we have added a pre-commit configuration in `.pre-commit-config.yaml`.
In order to use the pre-commit you first need to install a version of `.NET SDK` (We've tested with 10.0.102, but other
versions may work).

- [Instructions for installing .NET SDK](https://aka.ms/dotnet/download).

We recommend using [prek](https://github.com/j178/prek) as an alternative to pre-commit.
Run:
```
prek # to reformat staged files, or
prek run --all-files # at any time to fix all files.
```
Or with pre-commit:
```
pre-commit # to reformat staged files, or
pre-commit run --all-files # at any time to fix all files.
```

Optionally you can run `pre-commit install` or `prek install` to run these checks automatically on every commit.

## Acknowledgements

Funded by [Ménière’s & Vestibular UK](https://www.meandve.org.uk/).
9 changes: 3 additions & 6 deletions projects/AstroBalance/Assets/Scripts/CountdownTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ public class CountdownTimer : MonoBehaviour
{
private TextMeshProUGUI timerText;

private int timeLimit; // total time limit in seconds
private float timerStart; // time when timer was started
private int timeLimit; // total time limit in seconds
private float timerStart; // time when timer was started
private float timeRemaining; // time remaining in seconds

private bool timerRunning = false;
Expand All @@ -17,9 +17,7 @@ private void Awake()
}

// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
void Start() { }

// Update is called once per frame
void Update()
Expand Down Expand Up @@ -99,5 +97,4 @@ private void UpdateTimerText(float secondsLeft)

timerText.text = $"{minutes:00}:{seconds:00}";
}

}
1 change: 0 additions & 1 deletion projects/AstroBalance/Assets/Scripts/GazeCrosshair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ void Start()
// Update is called once per frame
void Update()
{

Vector3 worldPoint;
if (Application.isEditor)
{
Expand Down
2 changes: 1 addition & 1 deletion projects/AstroBalance/Assets/Scripts/GazeDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class GazeDisplay : MonoBehaviour
{
private Tracker tracker;
TextMeshProUGUI gazeText;

// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
Expand All @@ -18,7 +19,6 @@ void Update()
var gp = tracker.getGazePoint();
var gpWorld = tracker.getGazeWorldCoordinates();


gazeText.text = "Gaze Point: (" + gp.X + ", " + gp.Y + ") \n";
gazeText.text += "Unity coords: (" + gpWorld.x + ", " + gpWorld.y + ") \n";
}
Expand Down
12 changes: 10 additions & 2 deletions projects/AstroBalance/Assets/Scripts/PoseDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ void Update()
Position position = headPose.Position;
Rotation rotation = headPose.Rotation;

poseText.text = "Head position: (" + position.X + ", " + position.Y + ", " + position.Z + ") \n";
poseText.text += "Head rotation: (" + rotation.RollDegrees + ", " + rotation.PitchDegrees + ", " + rotation.YawDegrees + ") \n";
poseText.text =
"Head position: (" + position.X + ", " + position.Y + ", " + position.Z + ") \n";
poseText.text +=
"Head rotation: ("
+ rotation.RollDegrees
+ ", "
+ rotation.PitchDegrees
+ ", "
+ rotation.YawDegrees
+ ") \n";
}
}
Loading