Skip to content

Commit 255388b

Browse files
committed
updated README
1 parent 2173127 commit 255388b

File tree

2 files changed

+28
-29
lines changed

2 files changed

+28
-29
lines changed

Assets/UXF/Examples/Basic/BasicExample.unity

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ Prefab:
214214
- target: {fileID: 224130118367839794, guid: 0a3b6392f04558844bd340e68ced1ff9,
215215
type: 2}
216216
propertyPath: m_AnchorMax.x
217-
value: 0
217+
value: 1
218218
objectReference: {fileID: 0}
219219
- target: {fileID: 224130118367839794, guid: 0a3b6392f04558844bd340e68ced1ff9,
220220
type: 2}
221221
propertyPath: m_AnchorMax.y
222-
value: 0
222+
value: 1
223223
objectReference: {fileID: 0}
224224
- target: {fileID: 224286096967890162, guid: 0a3b6392f04558844bd340e68ced1ff9,
225225
type: 2}
@@ -244,7 +244,7 @@ Prefab:
244244
- target: {fileID: 224546371281550106, guid: 0a3b6392f04558844bd340e68ced1ff9,
245245
type: 2}
246246
propertyPath: m_SizeDelta.y
247-
value: 75
247+
value: 0
248248
objectReference: {fileID: 0}
249249
- target: {fileID: 224546371281550106, guid: 0a3b6392f04558844bd340e68ced1ff9,
250250
type: 2}

README.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
![Unity Experiment Framework](media/banner.png)
22

33
# UXF - Unity Experiment Framework
4-
A set of C# scripts which simplifies management of human-based experiments developed in Unity. This is the development project, if you want to download the package, see [Releases](https://github.com/jackbrookes/unity-experiment-manager/releases).
4+
A set of C# scripts which simplifies management of human-based experiments developed in Unity. This is the development project, if you want to download the package, see [Releases](https://github.com/jackbrookes/unity-experiment-framework/releases).
5+
6+
## Get started
7+
8+
Import the latest ```.unitypackage``` [release](https://github.com/jackbrookes/unity-experiment-framework/releases) to your existing Unity project.
9+
10+
Note: Users must change API Compatibility Level to .NET 2.0 in Unity player settings.
11+
512

613
## Features
714

@@ -47,23 +54,22 @@ UXF classes will be useful in two main parts of your project:
4754
```csharp
4855
class ExperimentBuilder : Monobehaviour
4956
{
50-
// set this to your ExperimentSession instance in the inspector
51-
public ExpMngr.ExperimentSession session;
57+
// set this to your Session instance in the inspector
58+
public UXF.Session session;
5259

53-
// call this function from ExperimentSession OnSessionBegin UnityEvent in its inspector
54-
public void GenerateAndRun()
55-
{
56-
// Creating a block
57-
var myBlock = new ExpMngr.Block(session);
58-
59-
// Creating 10 trials within our block
60-
for (int i = 0; i < 10; i++)
61-
new ExpMngr.Trial(myBlock);
60+
// assign this method to the Session OnSessionBegin UnityEvent in its inspector
61+
public void GenerateAndRun(UXF.Session session)
62+
{
63+
// Creating a block of 10 trials
64+
var myBlock = session.CreateBlock(10);
6265

6366
// Add a new setting to trial 1, here just as an example we will apply a setting of "color" "red"
64-
var firstTrial = myBlock.GetTrial(1);//trial number is not 0 indexed
67+
var firstTrial = myBlock.GetTrial(1); //trial number is not 0 indexed
6568
firstTrial.settings["color"] = "red";
6669

70+
// Save session instance reference
71+
this.session = session;
72+
6773
// Run first trial
6874
session.nextTrial.Begin();
6975
}
@@ -79,11 +85,12 @@ class ExperimentBuilder : Monobehaviour
7985
```csharp
8086
class SceneManipulator : MonoBehaviour
8187
{
82-
// set this to your ExperimentSession instance in the inspector
83-
public ExpMngr.ExperimentSession session;
88+
public UXF.Session session;
8489

85-
// call this function from ExperimentSession OnTrialBegin UnityEvent in its inspector
86-
public void RunTrial(ExpMngr.Trial trial)
90+
...
91+
92+
// assign this method to the Session OnTrialBegin UnityEvent in its inspector
93+
public void ShowStimulus(UXF.Trial trial)
8794
{
8895
// pull out the color we applied for this trial
8996
string colorManipulation = (string) trial.settings["color"];
@@ -93,7 +100,7 @@ class SceneManipulator : MonoBehaviour
93100
}
94101

95102
// this could trigger on some user behaviour, collecting their score in a task
96-
public void EndTrial(int score)
103+
public void RecordResultsAndEnd(int score)
97104
{
98105
// store their score
99106
session.currentTrial.results["score"] = score;
@@ -108,14 +115,6 @@ class SceneManipulator : MonoBehaviour
108115
See `Assets/ExpMngr/ExampleScript.cs` for another simple example.
109116

110117

111-
112-
## Get started
113-
114-
Download the project folder and open in Unity. Alternatively import the latest ```.unitypackage``` [release](https://github.com/jackbrookes/unity-experiment-manager/releases) to your existing Unity project.
115-
116-
Note: Users must change API Compatibility Level to .NET 2.0 in Unity player settings.
117-
118-
119118
## Development
120119

121120
This project is developed under Unity 2017.3.0f3.

0 commit comments

Comments
 (0)