Skip to content

Commit c3bc485

Browse files
committed
aws ddb web first pass
1 parent 166a446 commit c3bc485

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+4245
-215
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,6 @@ $RECYCLE.BIN/
6363

6464
# Visual Studio Code project
6565
.vscode/*
66-
example_output/*
66+
example_output/*
67+
68+
Assets/MyAWSCredentials.asset*

Assets/DevelopmentScene.unity

Lines changed: 151 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ RenderSettings:
3838
m_ReflectionIntensity: 1
3939
m_CustomReflection: {fileID: 0}
4040
m_Sun: {fileID: 0}
41-
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
41+
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
4242
m_UseRadianceAmbientProbe: 0
4343
--- !u!157 &3
4444
LightmapSettings:
4545
m_ObjectHideFlags: 0
4646
serializedVersion: 11
47-
m_GIWorkflowMode: 0
47+
m_GIWorkflowMode: 1
4848
m_GISettings:
4949
serializedVersion: 2
5050
m_BounceScale: 1
5151
m_IndirectOutputScale: 1
5252
m_AlbedoBoost: 1
5353
m_EnvironmentLightingMode: 0
5454
m_EnableBakedLightmaps: 1
55-
m_EnableRealtimeLightmaps: 1
55+
m_EnableRealtimeLightmaps: 0
5656
m_LightmapEditorSettings:
5757
serializedVersion: 10
5858
m_Resolution: 2
@@ -71,7 +71,7 @@ LightmapSettings:
7171
m_FinalGatherRayCount: 256
7272
m_ReflectionCompression: 2
7373
m_MixedBakeMode: 2
74-
m_BakeBackend: 0
74+
m_BakeBackend: 1
7575
m_PVRSampling: 1
7676
m_PVRDirectSampleCount: 32
7777
m_PVRSampleCount: 500
@@ -423,6 +423,21 @@ PrefabInstance:
423423
propertyPath: m_SizeDelta.y
424424
value: 0
425425
objectReference: {fileID: 0}
426+
- target: {fileID: 114916036141644208, guid: 0a3b6392f04558844bd340e68ced1ff9,
427+
type: 3}
428+
propertyPath: onSessionBegin.m_PersistentCalls.m_Calls.Array.size
429+
value: 0
430+
objectReference: {fileID: 0}
431+
- target: {fileID: 114916036141644208, guid: 0a3b6392f04558844bd340e68ced1ff9,
432+
type: 3}
433+
propertyPath: onSessionBegin.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
434+
value: 1
435+
objectReference: {fileID: 0}
436+
- target: {fileID: 114916036141644208, guid: 0a3b6392f04558844bd340e68ced1ff9,
437+
type: 3}
438+
propertyPath: onSessionBegin.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
439+
value: 2
440+
objectReference: {fileID: 0}
426441
- target: {fileID: 203569540471596912, guid: 0a3b6392f04558844bd340e68ced1ff9,
427442
type: 3}
428443
propertyPath: m_Value
@@ -828,6 +843,11 @@ PrefabInstance:
828843
propertyPath: m_SizeDelta.y
829844
value: 0
830845
objectReference: {fileID: 0}
846+
- target: {fileID: 653059108743847710, guid: 0a3b6392f04558844bd340e68ced1ff9,
847+
type: 3}
848+
propertyPath: settingsMode
849+
value: 2
850+
objectReference: {fileID: 0}
831851
- target: {fileID: 1334242383317073309, guid: 0a3b6392f04558844bd340e68ced1ff9,
832852
type: 3}
833853
propertyPath: m_AnchorMin.y
@@ -948,6 +968,47 @@ PrefabInstance:
948968
propertyPath: m_SizeDelta.y
949969
value: 0
950970
objectReference: {fileID: 0}
971+
- target: {fileID: 1726072748377084723, guid: 0a3b6392f04558844bd340e68ced1ff9,
972+
type: 3}
973+
propertyPath: m_AnchorMin.y
974+
value: 0
975+
objectReference: {fileID: 0}
976+
- target: {fileID: 1726072748377084723, guid: 0a3b6392f04558844bd340e68ced1ff9,
977+
type: 3}
978+
propertyPath: m_AnchorMax.y
979+
value: 0
980+
objectReference: {fileID: 0}
981+
- target: {fileID: 1726072748377084723, guid: 0a3b6392f04558844bd340e68ced1ff9,
982+
type: 3}
983+
propertyPath: m_AnchoredPosition.x
984+
value: 0
985+
objectReference: {fileID: 0}
986+
- target: {fileID: 1726072748377084723, guid: 0a3b6392f04558844bd340e68ced1ff9,
987+
type: 3}
988+
propertyPath: m_AnchoredPosition.y
989+
value: 0
990+
objectReference: {fileID: 0}
991+
- target: {fileID: 1726072748377084723, guid: 0a3b6392f04558844bd340e68ced1ff9,
992+
type: 3}
993+
propertyPath: m_SizeDelta.x
994+
value: 0
995+
objectReference: {fileID: 0}
996+
- target: {fileID: 1726072748377084723, guid: 0a3b6392f04558844bd340e68ced1ff9,
997+
type: 3}
998+
propertyPath: m_SizeDelta.y
999+
value: 0
1000+
objectReference: {fileID: 0}
1001+
- target: {fileID: 1999034067558573094, guid: 0a3b6392f04558844bd340e68ced1ff9,
1002+
type: 3}
1003+
propertyPath: active
1004+
value: 1
1005+
objectReference: {fileID: 0}
1006+
- target: {fileID: 1999034067558573094, guid: 0a3b6392f04558844bd340e68ced1ff9,
1007+
type: 3}
1008+
propertyPath: credentials
1009+
value:
1010+
objectReference: {fileID: 11400000, guid: 1d9e72d03c767f245a9967fa0862ae45,
1011+
type: 2}
9511012
- target: {fileID: 2076902335211466830, guid: 0a3b6392f04558844bd340e68ced1ff9,
9521013
type: 3}
9531014
propertyPath: m_AnchorMin.y
@@ -1018,6 +1079,16 @@ PrefabInstance:
10181079
propertyPath: m_AnchoredPosition.y
10191080
value: 0
10201081
objectReference: {fileID: 0}
1082+
- target: {fileID: 2896031059644693069, guid: 0a3b6392f04558844bd340e68ced1ff9,
1083+
type: 3}
1084+
propertyPath: m_IsActive
1085+
value: 0
1086+
objectReference: {fileID: 0}
1087+
- target: {fileID: 2897568975779925079, guid: 0a3b6392f04558844bd340e68ced1ff9,
1088+
type: 3}
1089+
propertyPath: m_IsActive
1090+
value: 0
1091+
objectReference: {fileID: 0}
10211092
- target: {fileID: 2897568975779925122, guid: 0a3b6392f04558844bd340e68ced1ff9,
10221093
type: 3}
10231094
propertyPath: m_AnchorMin.y
@@ -1048,36 +1119,66 @@ PrefabInstance:
10481119
propertyPath: m_SizeDelta.y
10491120
value: 0
10501121
objectReference: {fileID: 0}
1051-
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1122+
- target: {fileID: 2897568975779925142, guid: 0a3b6392f04558844bd340e68ced1ff9,
10521123
type: 3}
10531124
propertyPath: m_AnchorMin.y
10541125
value: 0
10551126
objectReference: {fileID: 0}
1056-
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1127+
- target: {fileID: 2897568975779925142, guid: 0a3b6392f04558844bd340e68ced1ff9,
10571128
type: 3}
10581129
propertyPath: m_AnchorMax.y
10591130
value: 0
10601131
objectReference: {fileID: 0}
1061-
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1132+
- target: {fileID: 2897568975779925142, guid: 0a3b6392f04558844bd340e68ced1ff9,
10621133
type: 3}
10631134
propertyPath: m_AnchoredPosition.x
10641135
value: 0
10651136
objectReference: {fileID: 0}
1066-
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1137+
- target: {fileID: 2897568975779925142, guid: 0a3b6392f04558844bd340e68ced1ff9,
10671138
type: 3}
10681139
propertyPath: m_AnchoredPosition.y
10691140
value: 0
10701141
objectReference: {fileID: 0}
1071-
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1142+
- target: {fileID: 2897568975779925142, guid: 0a3b6392f04558844bd340e68ced1ff9,
10721143
type: 3}
10731144
propertyPath: m_SizeDelta.x
10741145
value: 0
10751146
objectReference: {fileID: 0}
1076-
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1147+
- target: {fileID: 2897568975779925142, guid: 0a3b6392f04558844bd340e68ced1ff9,
10771148
type: 3}
10781149
propertyPath: m_SizeDelta.y
10791150
value: 0
10801151
objectReference: {fileID: 0}
1152+
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1153+
type: 3}
1154+
propertyPath: m_AnchorMin.y
1155+
value: 1
1156+
objectReference: {fileID: 0}
1157+
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1158+
type: 3}
1159+
propertyPath: m_AnchorMax.y
1160+
value: 1
1161+
objectReference: {fileID: 0}
1162+
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1163+
type: 3}
1164+
propertyPath: m_AnchoredPosition.x
1165+
value: 128
1166+
objectReference: {fileID: 0}
1167+
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1168+
type: 3}
1169+
propertyPath: m_AnchoredPosition.y
1170+
value: -10
1171+
objectReference: {fileID: 0}
1172+
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1173+
type: 3}
1174+
propertyPath: m_SizeDelta.x
1175+
value: 236
1176+
objectReference: {fileID: 0}
1177+
- target: {fileID: 3110759810348992417, guid: 0a3b6392f04558844bd340e68ced1ff9,
1178+
type: 3}
1179+
propertyPath: m_SizeDelta.y
1180+
value: 60
1181+
objectReference: {fileID: 0}
10811182
- target: {fileID: 4217236857037047594, guid: 0a3b6392f04558844bd340e68ced1ff9,
10821183
type: 3}
10831184
propertyPath: m_AnchorMin.y
@@ -1148,6 +1249,41 @@ PrefabInstance:
11481249
propertyPath: m_SizeDelta.y
11491250
value: 0
11501251
objectReference: {fileID: 0}
1252+
- target: {fileID: 4612929069887686480, guid: 0a3b6392f04558844bd340e68ced1ff9,
1253+
type: 3}
1254+
propertyPath: m_AnchorMin.y
1255+
value: 1
1256+
objectReference: {fileID: 0}
1257+
- target: {fileID: 4612929069887686480, guid: 0a3b6392f04558844bd340e68ced1ff9,
1258+
type: 3}
1259+
propertyPath: m_AnchorMax.y
1260+
value: 1
1261+
objectReference: {fileID: 0}
1262+
- target: {fileID: 4612929069887686480, guid: 0a3b6392f04558844bd340e68ced1ff9,
1263+
type: 3}
1264+
propertyPath: m_AnchoredPosition.x
1265+
value: 128
1266+
objectReference: {fileID: 0}
1267+
- target: {fileID: 4612929069887686480, guid: 0a3b6392f04558844bd340e68ced1ff9,
1268+
type: 3}
1269+
propertyPath: m_AnchoredPosition.y
1270+
value: -90
1271+
objectReference: {fileID: 0}
1272+
- target: {fileID: 4612929069887686480, guid: 0a3b6392f04558844bd340e68ced1ff9,
1273+
type: 3}
1274+
propertyPath: m_SizeDelta.x
1275+
value: 236
1276+
objectReference: {fileID: 0}
1277+
- target: {fileID: 4612929069887686480, guid: 0a3b6392f04558844bd340e68ced1ff9,
1278+
type: 3}
1279+
propertyPath: m_SizeDelta.y
1280+
value: 60
1281+
objectReference: {fileID: 0}
1282+
- target: {fileID: 4834968701760316578, guid: 0a3b6392f04558844bd340e68ced1ff9,
1283+
type: 3}
1284+
propertyPath: m_IsActive
1285+
value: 0
1286+
objectReference: {fileID: 0}
11511287
- target: {fileID: 4835438972542875700, guid: 0a3b6392f04558844bd340e68ced1ff9,
11521288
type: 3}
11531289
propertyPath: m_AnchorMin.y
@@ -1293,6 +1429,11 @@ PrefabInstance:
12931429
propertyPath: m_SizeDelta.y
12941430
value: 0
12951431
objectReference: {fileID: 0}
1432+
- target: {fileID: 6301449615104170796, guid: 0a3b6392f04558844bd340e68ced1ff9,
1433+
type: 3}
1434+
propertyPath: active
1435+
value: 0
1436+
objectReference: {fileID: 0}
12961437
- target: {fileID: 6476218619841064096, guid: 0a3b6392f04558844bd340e68ced1ff9,
12971438
type: 3}
12981439
propertyPath: m_AnchorMin.y

Assets/Testing.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Testing/AWSDDBTest.cs

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
using System;
2+
using System.Collections;
3+
using System.Collections.Generic;
4+
using UnityEngine;
5+
using UnityEngine.UI;
6+
7+
namespace UXF.Tests
8+
{
9+
public class AWSDDBTest : MonoBehaviour
10+
{
11+
public Session session;
12+
public WebAWSDynamoDB ddb;
13+
public Text showText;
14+
15+
Dictionary<string, object> dict = new Dictionary<string, object>()
16+
{
17+
{"string", "aaa"},
18+
{"bool", true},
19+
{"int", 3},
20+
{"float", 3.14f},
21+
{"list", new List<object>(){1, 2, 3, 4}},
22+
{"array", new object[]{1, 2, 3, 4}},
23+
{"object", new Dictionary<string, object>(){{"a", 1}, {"b", "abc"}}}
24+
};
25+
26+
List<object> list = new List<object>()
27+
{
28+
new Dictionary<string, object>(){ { "string", "aaa" } },
29+
new Dictionary<string, object>(){ { "string", "aaa" } },
30+
new Dictionary<string, object>(){ { "string", "aaa" } }
31+
};
32+
33+
public void StartAndEndATrial()
34+
{
35+
Block b = session.CreateBlock(1);
36+
37+
b.firstTrial.Begin();
38+
b.firstTrial.result["result"] = 12345;
39+
b.firstTrial.End();
40+
}
41+
42+
public void CreateSessionData()
43+
{
44+
session.SaveJSONSerializableObject(dict, "dict");
45+
session.SaveJSONSerializableObject(list, "list");
46+
session.SaveText("adfiodsfgiusdfgisdfgjsdfgij\nsdfwef", "text");
47+
}
48+
49+
public void CreateTrialData()
50+
{
51+
session.CurrentTrial.SaveJSONSerializableObject(dict, "dict");
52+
session.CurrentTrial.SaveJSONSerializableObject(list, "list");
53+
session.CurrentTrial.SaveText("adfiodsfgiusdfgisdfgjsdfgij\nsdfwef", "text");
54+
}
55+
56+
public void GetSessionData()
57+
{
58+
ddb.GetUXFDataFromDB(session.experimentName, UXFDataType.OtherSessionData, session.ppid, session.number, "dict", ShowDict);
59+
}
60+
61+
public void GetTrialData()
62+
{
63+
ddb.GetUXFDataFromDB(session.experimentName, UXFDataType.OtherTrialData, session.ppid, session.number, "dict", ShowDict, session.currentTrialNum);
64+
}
65+
66+
void ShowDict(Dictionary<string, object> dict)
67+
{
68+
if (dict == null)
69+
{
70+
showText.text = "Response was null";
71+
return;
72+
}
73+
74+
Debug.LogFormat("Keys are: ", string.Join(", ", dict.Keys));
75+
76+
string newText = string.Format("Response at time: {0}\n", Time.realtimeSinceStartup);
77+
newText += string.Format("string: {0}\n", dict["string"]);
78+
newText += string.Format("bool: {0}\n", dict["bool"]);
79+
newText += string.Format("int: {0}\n", dict["int"]);
80+
newText += string.Format("float: {0}\n", dict["float"]);
81+
newText += string.Format("list: {0}\n", dict["list"]);
82+
newText += string.Format("array: {0}\n", dict["array"]);
83+
newText += string.Format("object: {0}\n", dict["object"]);
84+
85+
showText.text = newText;
86+
}
87+
88+
public void EndSession()
89+
{
90+
session.End();
91+
}
92+
93+
}
94+
95+
}
96+

Assets/Testing/AWSDDBTest.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)