Skip to content

Commit 31d6f14

Browse files
committed
move to target example fix
1 parent 1a571dc commit 31d6f14

File tree

7 files changed

+226
-40
lines changed

7 files changed

+226
-40
lines changed

Assets/UXF/Examples/2_MoveToTarget/MoveToTargetExample.unity

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,11 @@ PrefabInstance:
13811381
propertyPath: m_SizeDelta.y
13821382
value: 0
13831383
objectReference: {fileID: 0}
1384+
- target: {fileID: 653059108743847710, guid: 0a3b6392f04558844bd340e68ced1ff9,
1385+
type: 3}
1386+
propertyPath: participantDataPoints.Array.size
1387+
value: 1
1388+
objectReference: {fileID: 0}
13841389
- target: {fileID: 653059108743847710, guid: 0a3b6392f04558844bd340e68ced1ff9,
13851390
type: 3}
13861391
propertyPath: settingsSearchPattern
@@ -1391,6 +1396,21 @@ PrefabInstance:
13911396
propertyPath: termsAndConditions
13921397
value: Please tick if you understand the instructions.<color=red>*</color>
13931398
objectReference: {fileID: 0}
1399+
- target: {fileID: 653059108743847710, guid: 0a3b6392f04558844bd340e68ced1ff9,
1400+
type: 3}
1401+
propertyPath: participantDataPoints.Array.data[0].dataType
1402+
value: 3
1403+
objectReference: {fileID: 0}
1404+
- target: {fileID: 653059108743847710, guid: 0a3b6392f04558844bd340e68ced1ff9,
1405+
type: 3}
1406+
propertyPath: participantDataPoints.Array.data[0].displayName
1407+
value: Inverted Block First
1408+
objectReference: {fileID: 0}
1409+
- target: {fileID: 653059108743847710, guid: 0a3b6392f04558844bd340e68ced1ff9,
1410+
type: 3}
1411+
propertyPath: participantDataPoints.Array.data[0].internalName
1412+
value: inverted_block_first
1413+
objectReference: {fileID: 0}
13941414
- target: {fileID: 1507222259595111547, guid: 0a3b6392f04558844bd340e68ced1ff9,
13951415
type: 3}
13961416
propertyPath: m_AnchorMin.y
@@ -1421,6 +1441,36 @@ PrefabInstance:
14211441
propertyPath: m_SizeDelta.y
14221442
value: 0
14231443
objectReference: {fileID: 0}
1444+
- target: {fileID: 1726072748377084700, guid: 0a3b6392f04558844bd340e68ced1ff9,
1445+
type: 3}
1446+
propertyPath: m_AnchorMin.y
1447+
value: 0
1448+
objectReference: {fileID: 0}
1449+
- target: {fileID: 1726072748377084700, guid: 0a3b6392f04558844bd340e68ced1ff9,
1450+
type: 3}
1451+
propertyPath: m_AnchorMax.y
1452+
value: 0
1453+
objectReference: {fileID: 0}
1454+
- target: {fileID: 1726072748377084700, guid: 0a3b6392f04558844bd340e68ced1ff9,
1455+
type: 3}
1456+
propertyPath: m_AnchoredPosition.x
1457+
value: 0
1458+
objectReference: {fileID: 0}
1459+
- target: {fileID: 1726072748377084700, guid: 0a3b6392f04558844bd340e68ced1ff9,
1460+
type: 3}
1461+
propertyPath: m_AnchoredPosition.y
1462+
value: 0
1463+
objectReference: {fileID: 0}
1464+
- target: {fileID: 1726072748377084700, guid: 0a3b6392f04558844bd340e68ced1ff9,
1465+
type: 3}
1466+
propertyPath: m_SizeDelta.x
1467+
value: 0
1468+
objectReference: {fileID: 0}
1469+
- target: {fileID: 1726072748377084700, guid: 0a3b6392f04558844bd340e68ced1ff9,
1470+
type: 3}
1471+
propertyPath: m_SizeDelta.y
1472+
value: 0
1473+
objectReference: {fileID: 0}
14241474
- target: {fileID: 1726072748377084703, guid: 0a3b6392f04558844bd340e68ced1ff9,
14251475
type: 3}
14261476
propertyPath: m_AnchorMin.y
@@ -1521,6 +1571,36 @@ PrefabInstance:
15211571
propertyPath: m_SizeDelta.y
15221572
value: 0
15231573
objectReference: {fileID: 0}
1574+
- target: {fileID: 2897568975779925135, guid: 0a3b6392f04558844bd340e68ced1ff9,
1575+
type: 3}
1576+
propertyPath: m_AnchorMin.y
1577+
value: 0
1578+
objectReference: {fileID: 0}
1579+
- target: {fileID: 2897568975779925135, guid: 0a3b6392f04558844bd340e68ced1ff9,
1580+
type: 3}
1581+
propertyPath: m_AnchorMax.y
1582+
value: 0
1583+
objectReference: {fileID: 0}
1584+
- target: {fileID: 2897568975779925135, guid: 0a3b6392f04558844bd340e68ced1ff9,
1585+
type: 3}
1586+
propertyPath: m_AnchoredPosition.x
1587+
value: 0
1588+
objectReference: {fileID: 0}
1589+
- target: {fileID: 2897568975779925135, guid: 0a3b6392f04558844bd340e68ced1ff9,
1590+
type: 3}
1591+
propertyPath: m_AnchoredPosition.y
1592+
value: 0
1593+
objectReference: {fileID: 0}
1594+
- target: {fileID: 2897568975779925135, guid: 0a3b6392f04558844bd340e68ced1ff9,
1595+
type: 3}
1596+
propertyPath: m_SizeDelta.x
1597+
value: 0
1598+
objectReference: {fileID: 0}
1599+
- target: {fileID: 2897568975779925135, guid: 0a3b6392f04558844bd340e68ced1ff9,
1600+
type: 3}
1601+
propertyPath: m_SizeDelta.y
1602+
value: 0
1603+
objectReference: {fileID: 0}
15241604
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
15251605
type: 3}
15261606
propertyPath: m_AnchorMin.y
@@ -1631,6 +1711,41 @@ PrefabInstance:
16311711
propertyPath: m_SizeDelta.y
16321712
value: 0
16331713
objectReference: {fileID: 0}
1714+
- target: {fileID: 4835438972542875703, guid: 0a3b6392f04558844bd340e68ced1ff9,
1715+
type: 3}
1716+
propertyPath: m_AnchorMin.y
1717+
value: 0
1718+
objectReference: {fileID: 0}
1719+
- target: {fileID: 4835438972542875703, guid: 0a3b6392f04558844bd340e68ced1ff9,
1720+
type: 3}
1721+
propertyPath: m_AnchorMax.y
1722+
value: 0
1723+
objectReference: {fileID: 0}
1724+
- target: {fileID: 4835438972542875703, guid: 0a3b6392f04558844bd340e68ced1ff9,
1725+
type: 3}
1726+
propertyPath: m_AnchoredPosition.x
1727+
value: 0
1728+
objectReference: {fileID: 0}
1729+
- target: {fileID: 4835438972542875703, guid: 0a3b6392f04558844bd340e68ced1ff9,
1730+
type: 3}
1731+
propertyPath: m_AnchoredPosition.y
1732+
value: 0
1733+
objectReference: {fileID: 0}
1734+
- target: {fileID: 4835438972542875703, guid: 0a3b6392f04558844bd340e68ced1ff9,
1735+
type: 3}
1736+
propertyPath: m_SizeDelta.x
1737+
value: 0
1738+
objectReference: {fileID: 0}
1739+
- target: {fileID: 4835438972542875703, guid: 0a3b6392f04558844bd340e68ced1ff9,
1740+
type: 3}
1741+
propertyPath: m_SizeDelta.y
1742+
value: 0
1743+
objectReference: {fileID: 0}
1744+
- target: {fileID: 4835438972542875814, guid: 0a3b6392f04558844bd340e68ced1ff9,
1745+
type: 3}
1746+
propertyPath: m_IsActive
1747+
value: 1
1748+
objectReference: {fileID: 0}
16341749
- target: {fileID: 4835438972542875823, guid: 0a3b6392f04558844bd340e68ced1ff9,
16351750
type: 3}
16361751
propertyPath: m_IsActive
@@ -1711,6 +1826,41 @@ PrefabInstance:
17111826
propertyPath: m_SizeDelta.y
17121827
value: 0
17131828
objectReference: {fileID: 0}
1829+
- target: {fileID: 7839017981507438752, guid: 0a3b6392f04558844bd340e68ced1ff9,
1830+
type: 3}
1831+
propertyPath: m_Text
1832+
value:
1833+
objectReference: {fileID: 0}
1834+
- target: {fileID: 7877310278013525285, guid: 0a3b6392f04558844bd340e68ced1ff9,
1835+
type: 3}
1836+
propertyPath: m_AnchorMin.y
1837+
value: 0
1838+
objectReference: {fileID: 0}
1839+
- target: {fileID: 7877310278013525285, guid: 0a3b6392f04558844bd340e68ced1ff9,
1840+
type: 3}
1841+
propertyPath: m_AnchorMax.y
1842+
value: 0
1843+
objectReference: {fileID: 0}
1844+
- target: {fileID: 7877310278013525285, guid: 0a3b6392f04558844bd340e68ced1ff9,
1845+
type: 3}
1846+
propertyPath: m_AnchoredPosition.x
1847+
value: 0
1848+
objectReference: {fileID: 0}
1849+
- target: {fileID: 7877310278013525285, guid: 0a3b6392f04558844bd340e68ced1ff9,
1850+
type: 3}
1851+
propertyPath: m_AnchoredPosition.y
1852+
value: 0
1853+
objectReference: {fileID: 0}
1854+
- target: {fileID: 7877310278013525285, guid: 0a3b6392f04558844bd340e68ced1ff9,
1855+
type: 3}
1856+
propertyPath: m_SizeDelta.x
1857+
value: 0
1858+
objectReference: {fileID: 0}
1859+
- target: {fileID: 7877310278013525285, guid: 0a3b6392f04558844bd340e68ced1ff9,
1860+
type: 3}
1861+
propertyPath: m_SizeDelta.y
1862+
value: 0
1863+
objectReference: {fileID: 0}
17141864
- target: {fileID: 7877310278013525286, guid: 0a3b6392f04558844bd340e68ced1ff9,
17151865
type: 3}
17161866
propertyPath: m_AnchorMin.y
@@ -1746,6 +1896,36 @@ PrefabInstance:
17461896
propertyPath: m_Text
17471897
value:
17481898
objectReference: {fileID: 0}
1899+
- target: {fileID: 7948667913022628418, guid: 0a3b6392f04558844bd340e68ced1ff9,
1900+
type: 3}
1901+
propertyPath: m_AnchorMin.y
1902+
value: 0
1903+
objectReference: {fileID: 0}
1904+
- target: {fileID: 7948667913022628418, guid: 0a3b6392f04558844bd340e68ced1ff9,
1905+
type: 3}
1906+
propertyPath: m_AnchorMax.y
1907+
value: 0
1908+
objectReference: {fileID: 0}
1909+
- target: {fileID: 7948667913022628418, guid: 0a3b6392f04558844bd340e68ced1ff9,
1910+
type: 3}
1911+
propertyPath: m_AnchoredPosition.x
1912+
value: 0
1913+
objectReference: {fileID: 0}
1914+
- target: {fileID: 7948667913022628418, guid: 0a3b6392f04558844bd340e68ced1ff9,
1915+
type: 3}
1916+
propertyPath: m_AnchoredPosition.y
1917+
value: 0
1918+
objectReference: {fileID: 0}
1919+
- target: {fileID: 7948667913022628418, guid: 0a3b6392f04558844bd340e68ced1ff9,
1920+
type: 3}
1921+
propertyPath: m_SizeDelta.x
1922+
value: 0
1923+
objectReference: {fileID: 0}
1924+
- target: {fileID: 7948667913022628418, guid: 0a3b6392f04558844bd340e68ced1ff9,
1925+
type: 3}
1926+
propertyPath: m_SizeDelta.y
1927+
value: 0
1928+
objectReference: {fileID: 0}
17491929
- target: {fileID: 8307715182677704244, guid: 0a3b6392f04558844bd340e68ced1ff9,
17501930
type: 3}
17511931
propertyPath: m_AnchorMax.x

Assets/UXF/Examples/2_MoveToTarget/Scripts/Example_ExperimentGenerator.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class Example_ExperimentGenerator : MonoBehaviour
1010
{
1111
public void Generate(Session session)
1212
{
13-
int numTrials = session.settings.GetInt("trials_per_block");
13+
int numTrials = session.settings.GetInt("trials_per_block", 10);
1414

1515
// create two blocks
1616
Block block1 = session.CreateBlock(numTrials);
@@ -37,6 +37,12 @@ public void Generate(Session session)
3737
catch (System.NullReferenceException)
3838
{
3939
// during quick start mode, there are no participant details, so we get null reference exception
40+
invertedBlockFirst = Random.value > 0.5;
41+
Debug.LogFormat("Inverted block first: {0}", invertedBlockFirst);
42+
}
43+
catch (KeyNotFoundException)
44+
{
45+
// during quick start mode, there are no participant details, so we get null reference exception
4046
invertedBlockFirst = Random.value > 0.5;
4147
Debug.LogFormat("Inverted block first: {0}", invertedBlockFirst);
4248
}
@@ -61,7 +67,7 @@ public void Generate(Session session)
6167
/// <param name="block"></param>
6268
void MakeCatchTrials(Block block)
6369
{
64-
int numCatchTrials = block.settings.GetInt("catch_trials_per_block");
70+
int numCatchTrials = block.settings.GetInt("catch_trials_per_block", 2);
6571

6672
if (numCatchTrials > block.trials.Count)
6773
{
@@ -72,7 +78,7 @@ void MakeCatchTrials(Block block)
7278
{
7379
// double the existing delay time during catch trials
7480
Trial trial = block.trials[i];
75-
float delayTime = 2 * trial.settings.GetFloat("delay_time");
81+
float delayTime = 2 * trial.settings.GetFloat("delay_time", 0.5f);
7682
trial.settings.SetValue("delay_time", delayTime);
7783
}
7884

Assets/UXF/Examples/2_MoveToTarget/Scripts/Example_InstructionsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void UpdateInstructions()
4141
return;
4242
}
4343

44-
bool inverted = nextTrial.settings.GetBool("inverted");
44+
bool inverted = nextTrial.settings.GetBool("inverted", false);
4545
text.text = inverted ? invertedInstructions : normalInstructions;
4646

4747
}

Assets/UXF/Examples/2_MoveToTarget/Scripts/Example_StartBlockController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ IEnumerator RunSequence()
4040
// Take the delay time (seconds) for the next trial, wait for that time
4141
// If we move from the start block too early, StopCoroutine(runningSequence); will halt the execution of this coroutine
4242
// System.Convert: Safely convert to single (float)
43-
float delayTime = session.NextTrial.settings.GetFloat("delay_time");
43+
float delayTime = session.NextTrial.settings.GetFloat("delay_time", 0.5f);
4444
yield return new WaitForSeconds(delayTime);
4545

4646
Go();

0 commit comments

Comments
 (0)