Skip to content

Commit 39b3581

Browse files
committed
Fix bug in UXF
There was a UI bug where if a session number for a particular participant already exists, the application would throw a NullReferenceException in a standalone build. This change will be made in a fork of UXF and a pull request will be done.
1 parent 6da7e68 commit 39b3581

9 files changed

Lines changed: 17 additions & 13 deletions

File tree

Assets/Scripts/DotStimulus/Dot.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public Dot(Vector2 velocity, Vector3 startingPosition, StimulusSettings settings
3636

3737
public void UpdateDot()
3838
{
39+
var deltaTime = Time.deltaTime;
40+
3941
if (_elapsedTime > Random.Range(_settings.minDotLifetime, _settings.maxDotLifetime))
4042
{
4143
var randomPosition = Random.insideUnitCircle * _apertureRadius;
@@ -45,8 +47,8 @@ public void UpdateDot()
4547
}
4648
else
4749
{
48-
_currentPosition.x += _velocity.x * Time.deltaTime;
49-
_currentPosition.z += _velocity.y * Time.deltaTime;
50+
_currentPosition.x += _velocity.x * deltaTime;
51+
_currentPosition.z += _velocity.y * deltaTime;
5052

5153
// Square magnitude used for efficiency
5254
if (_currentPosition.sqrMagnitude > _sqrApertureRadius)
@@ -57,7 +59,7 @@ public void UpdateDot()
5759
}
5860

5961
Position = _currentPosition;
60-
_elapsedTime += Time.deltaTime;
62+
_elapsedTime += deltaTime;
6163
_oldPosition = _currentPosition;
6264
}
6365
}

Assets/Scripts/SessionManager.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scripts/Trial Manager/TrialManager.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/StreamingAssets/TEMPLATE.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
"MinDotLifetimeSeconds": 0.2,
1212
"MaxDotLifetimeSeconds": 0.5,
1313
"OuterStimulusDurationMs": 5000,
14-
"OuterStimulusRadiusDegrees": 45,
14+
"OuterStimulusRadiusDegrees": 55,
1515
"OuterStimulusNoisePercentage": 100,
1616
"InnerStimulusDurationMs": 500,
1717
"InnerStimulusRadiusDegrees": 5,
18-
"InnerStimulusNoisePercentage": 25,
18+
"InnerStimulusNoisePercentage": 100,
1919
"InnerStimulusSpawnRadius": 30,
2020

2121
"StimulusSpacingMeters": 0.001,
2222

23-
"StimulusDepthMeters": 0.57,
23+
"StimulusDepthMeters": 2.0,
2424

2525
"InterTrialDelaySeconds": 2.5,
2626

Assets/UXF/Scripts/UI/UIController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ void Awake()
157157
{
158158
if (session == null) session = GetComponentInParent<Session>();
159159
if (canvas == null) canvas = GetComponent<Canvas>();
160+
if (popupController == null) popupController = GetComponentInChildren<PopupController>(true);
160161
// read word list
161162
if (uuidWordList) words = uuidWordList.text.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
162163
GenerateSidebar();
@@ -389,7 +390,7 @@ IEnumerator TryBeginSessionFromUISequence()
389390

390391
if (exists)
391392
{
392-
Popup newPopup = new Popup()
393+
Popup newPopup = new Popup
393394
{
394395
message = string.Format(
395396
"{0} - {1} - Session #{2} already exists! Press OK to start the session anyway, data may be overwritten.",

Assets/XR/Settings/Open VR Settings.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ MonoBehaviour:
1919
InitializationType: 1
2020
EditorAppKey: application.generated.unity.dotstimulustest.exe
2121
ActionManifestFileRelativeFilePath: StreamingAssets\SteamVR\actions.json
22-
MirrorView: 0
22+
MirrorView: 1
2323
HasCopiedDefaults: 0

ProjectSettings/ProjectSettings.asset

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ PlayerSettings:
125125
16:9: 1
126126
Others: 1
127127
bundleVersion: 0.1
128-
preloadedAssets: []
128+
preloadedAssets:
129+
- {fileID: 6405742922248523384, guid: efde690a735af1f4a89b7bfd2c31a41a, type: 2}
129130
metroInputSource: 0
130131
wsaTransparentSwapchain: 0
131132
m_HolographicPauseOnTrackingLoss: 1

ProjectSettings/TimeManager.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--- !u!5 &1
44
TimeManager:
55
m_ObjectHideFlags: 0
6-
Fixed Timestep: 0.02
6+
Fixed Timestep: 0.00833333
77
Maximum Allowed Timestep: 0.33333334
88
m_TimeScale: 1
99
Maximum Particle Timestep: 0.03

ProjectSettings/VFXManager.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ VFXManager:
88
m_SortShader: {fileID: 0}
99
m_StripUpdateShader: {fileID: 0}
1010
m_RenderPipeSettingsPath:
11-
m_FixedTimeStep: 0.016666668
11+
m_FixedTimeStep: 0.00833333
1212
m_MaxDeltaTime: 0.05

0 commit comments

Comments
 (0)