Draft: Sprint 2 #37

Closed
jeldgees wants to merge 11 commits from development into main
147 changed files with 1049 additions and 7592 deletions

View File

@@ -36,11 +36,12 @@ steps:
- name: unity-builds
image: docker.io/library/unity-runner:0.1
commands:
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildWindowsPlayer ./wesign-builds/WeSign-Windows.exe -quit --headless || true
- mkdir -p ./wesign-builds/{tmp,WeSign-Windows,WeSign-Linux,WeSign-MacOS}
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildWindowsPlayer ./wesign-builds/tmp/WeSign-Windows.exe -quit --headless || true
- chmod 777 -R .
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildWindowsPlayer ./wesign-builds/WeSign-Windows.exe -quit --headless
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildLinux64Player ./wesign-builds/WeSign-Linux -quit --headless
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildOSXUniversalPlayer ./wesign-builds/WeSign-MacOS.app -quit --headless
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildWindowsPlayer ./wesign-builds/WeSign-Windows/WeSign.exe -quit --headless
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildLinux64Player ./wesign-builds/WeSign-Linux/WeSign -quit --headless
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildOSXUniversalPlayer ./wesign-builds/WeSign-MacOS/WeSign.app -quit --headless
- name: commit-files
image: alpine/git
environment:
@@ -51,9 +52,14 @@ steps:
commands:
- git config --global user.name "DroneCI"
- git config --global user.email "droneci@wesign.com"
- ls ./wesign-builds
- git add -f ./wesign-builds/WeSign-Windows.exe
- git add -f ./wesign-builds/WeSign-Linux
- git add -f ./wesign-builds/WeSign-MacOS.app
- zip -r ./wesign-builds/WeSign-Windows.zip ./wesign-builds/WeSign-Windows
- zip -r ./wesign-builds/WeSign-MacOS.zip ./wesign-builds/WeSign-MacOS
- zip -r ./wesign-builds/WeSign-Linux.zip ./wesign-builds/WeSign-Linux
- git add ./wesign-builds/WeSign-Windows.zip
- git add ./wesign-builds/WeSign-MacOS.zip
- git add ./wesign-builds/WeSign-Linux.zip
- git commit -m "Add build files [skip ci]"
- git push -f https://oauth2:ixKiNbp48zzmP5PF-epo@gitlab.ilabt.imec.be/wesign/unity-application/

View File

@@ -1097,7 +1097,6 @@ GameObject:
- component: {fileID: 1143249627}
- component: {fileID: 1143249626}
- component: {fileID: 1143249625}
- component: {fileID: 1143249628}
m_Layer: 5
m_Name: Button (1)
m_TagString: Untagged
@@ -1170,10 +1169,10 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1143249628}
m_TargetAssemblyTypeName: ChangeSceneOnClick, Assembly-CSharp
m_MethodName: LoadScene
m_Mode: 5
- m_Target: {fileID: 906197780}
m_TargetAssemblyTypeName: ChangeUserScreen, Assembly-CSharp
m_MethodName: GotoUserCreation
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
@@ -1220,18 +1219,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1143249623}
m_CullTransparentMesh: 1
--- !u!114 &1143249628
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1143249623}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 949ba4da8595d52aebc98e6f9b6a405e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1229328479
GameObject:
m_ObjectHideFlags: 0

View File

@@ -0,0 +1,17 @@
{
"name": "AccountsScripts",
"rootNamespace": "",
"references": [
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:df9d7b70293a2e14d9d3a018c3956f7a"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b3d66002fb543bf3fa03c11006f8cb3a
guid: 1631ed2680c61245b8211d943c1639a8
AssemblyDefinitionImporter:
externalObjects: {}
userData:

View File

@@ -1,9 +1,11 @@
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
/// <summary>
/// ChangeUserScreen scene manager
/// </summary>
public class ChangeUserScreen : MonoBehaviour
{
/// <summary>
@@ -58,12 +60,7 @@ public class ChangeUserScreen : MonoBehaviour
// Set background color
background.color = i == currentUserIndex ? Color.blue : Color.gray;
// Find correct component for setting the sprite
foreach (Image img in background.GetComponentsInChildren<Image>())
if (img != background)
{
img.sprite = user.avatar;
break;
}
instance.transform.Find("Avatar").GetComponent<Image>().sprite = user.avatar;
}
}
@@ -85,6 +82,14 @@ public class ChangeUserScreen : MonoBehaviour
{
userList.ChangeCurrentUser(currentUserIndex);
userList.Save();
SceneManager.LoadScene("Common/Scenes/StartScreen");
SystemController.GetInstance().BackToPreviousScene();
}
/// <summary>
/// Callback to load the UserCreationScreen scene
/// </summary>
public void GotoUserCreation()
{
SystemController.GetInstance().LoadNextScene("Accounts/Scenes/UserCreationScreen");
}
}

View File

@@ -73,7 +73,6 @@ public class Progress
}
}
// Get the value of type `T` belonging to `key`
/// <summary>
/// Get the data object of a certain key
/// </summary>

View File

@@ -0,0 +1,104 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
/// <summary>
/// SystemController singleton
/// </summary>
public class SystemController
{
/// <summary>
/// The instance controlling the singleton
/// </summary>
private static SystemController instance = null;
/// <summary>
/// Stack of the loaded scenes, used to easily go back to previous scenes
/// </summary>
private Stack<int> sceneStack = new Stack<int>();
/// <summary>
/// Get the instance loaded by the singleton
/// </summary>
/// <returns>SystemController instance</returns>
public static SystemController GetInstance()
{
// Create a new instance if non exists
if (instance == null)
{
instance = new SystemController();
instance.sceneStack.Push(SceneManager.GetActiveScene().buildIndex);
}
return instance;
}
/// <summary>
/// Load the scene and push on the stack
/// </summary>
/// <param name="scenePath">Path of the scene</param>
public void LoadNextScene(string scenePath)
{
LoadNextScene(SceneUtility.GetBuildIndexByScenePath(scenePath));
}
/// <summary>
/// Load the scene and push on the stack
/// </summary>
/// <param name="sceneIndex">Buildindex of the scene</param>
public void LoadNextScene(int sceneIndex)
{
sceneStack.Push(sceneIndex);
SceneManager.LoadScene(sceneIndex);
}
/// <summary>
/// Swap the current scene with the new scene on the stack
/// </summary>
/// <param name="scenePath">Path of the scene</param>
public void SwapScene(string scenePath)
{
SwapScene(SceneUtility.GetBuildIndexByScenePath(scenePath));
}
/// <summary>
/// Swap the current scene with the new scene on the stack
/// </summary>
/// <param name="sceneIndex">Buildindex of the scene</param>
public void SwapScene(int sceneIndex)
{
sceneStack.Pop();
LoadNextScene(sceneIndex);
}
/// <summary>
/// Go back to the previous scene and unload the current scene
/// </summary>
public void BackToPreviousScene()
{
sceneStack.Pop();
if (sceneStack.Count > 0) SceneManager.LoadScene(sceneStack.Peek());
else Application.Quit();
}
/// <summary>
/// Go back to a specific scene, unloading all the scenes on the way
/// </summary>
/// <param name="scenePath">Path of the scene</param>
public void BackToScene(string scenePath)
{
BackToScene(SceneUtility.GetBuildIndexByScenePath(scenePath));
}
/// <summary>
/// Go back to a specific scene, unloading all the scene on the way
/// </summary>
/// <param name="sceneIndex">Buildindex of the scene</param>
public void BackToScene(int sceneIndex)
{
while (0 < sceneStack.Count && sceneStack.Peek() != sceneIndex) sceneStack.Pop();
if (sceneStack.Count > 0) SceneManager.LoadScene(sceneStack.Peek());
else Application.Quit();
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 949ba4da8595d52aebc98e6f9b6a405e
guid: bf5ea73aa43049e45a0ad926db15f315
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -2,7 +2,6 @@ using System.Collections.Generic;
using System.Text.RegularExpressions;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
/// <summary>
@@ -80,12 +79,7 @@ public class UserCreationScreen : MonoBehaviour
// Set background color
background.color = selectedAvatar == i ? Color.blue : Color.gray;
// Find correct component for setting the sprite
foreach (Image img in background.GetComponentsInChildren<Image>())
if (img != background)
{
img.sprite = sprites[i];
break;
}
instance.transform.Find("Image").GetComponent<Image>().sprite = sprites[i];
}
}
@@ -123,8 +117,7 @@ public class UserCreationScreen : MonoBehaviour
{
// Create a new entry in the UserList ScriptableObject
users.ChangeCurrentUser(users.CreateAndAddNewUser(username, sprites[selectedAvatar]));
// TODO: change scene, for now just change to StartScreen
SceneManager.LoadScene("Common/Scenes/StartScreen");
SystemController.GetInstance().BackToPreviousScene();
}
// Warn user that username already exists
else

View File

@@ -0,0 +1,27 @@
{
"name": "AccountsTests",
"rootNamespace": "",
"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner",
"AccountsScripts",
"InterfacesScripts"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll",
"nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS",
"UNITY_INCLUDE_TESTS"
],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 29594155802425940b4fd7351ad447e8
TextScriptImporter:
guid: 8500f5aede7627729bd8c97b15e541c4
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:

View File

@@ -1,3 +1,4 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
@@ -90,6 +91,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test for creation of a new progress
/// </summary>
[Test]
public void TestNewProgress()
{
Progress progress = new Progress();
@@ -99,6 +101,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether invalid data will not be added
/// </summary>
[Test]
public void TestProgressAddInvalidData()
{
Progress progress = new Progress();
@@ -108,6 +111,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether a duplicated key will be added
/// </summary>
[Test]
public void TestProgressAddDuplicateKey()
{
Progress progress = new Progress();
@@ -118,6 +122,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether a <c>int</c> value can be added
/// </summary>
[Test]
public void TestProgressAddInt()
{
Progress progress = new Progress();
@@ -127,6 +132,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether a <c>double</c> value can be added
/// </summary>
[Test]
public void TestProgressAddDouble()
{
Progress progress = new Progress();
@@ -136,6 +142,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether a <c>string</c> value can be added
/// </summary>
[Test]
public void TestProgressAddString()
{
Progress progress = new Progress();
@@ -145,6 +152,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether a serializable struct can be added
/// </summary>
[Test]
public void TestProgressAddSerializableStruct()
{
Progress progress = new Progress();
@@ -154,6 +162,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether a non-serializable struct will throw an error
/// </summary>
[Test]
public void TestProgressAddNonSerializableStruct()
{
Debug.Assert(AddNonSerializableStruct());
@@ -162,6 +171,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether an invalid key will throw an error
/// </summary>
[Test]
public void TestProgressGetInvalidKey()
{
Debug.Assert(AccessInvalidKey());
@@ -170,6 +180,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether an invalid type will throw an error
/// </summary>
[Test]
public void TestProgressGetInvalidType()
{
Debug.Assert(AccessInvalidType());
@@ -178,6 +189,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether a value is correctly updated
/// </summary>
[Test]
public void TestProgressUpdate()
{
Progress progress = new Progress();
@@ -190,6 +202,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether a <c>int</c> value can be read
/// </summary>
[Test]
public void TestProgressGetInt()
{
Progress progress = new Progress();
@@ -200,6 +213,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether a <c>double</c> value can be read
/// </summary>
[Test]
public void TestProgressGetDouble()
{
Progress progress = new Progress();
@@ -210,6 +224,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether a <c>string</c> value can be read
/// </summary>
[Test]
public void TestProgressGetString()
{
Progress progress = new Progress();
@@ -220,6 +235,7 @@ public class TestProgress : MonoBehaviour
/// <summary>
/// Test whether a serializable struct can be read
/// </summary>
[Test]
public void TestProgressGetStruct()
{
Progress progress = new Progress();

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 55cd80546e3f9d043b59677c12f0e891
guid: e88996685ebf2274ea70a64e08b7ddd7
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3ac4eb825ce7bf5499f083eaf34d5d4d
guid: a5bf21dee022ed0489face1c734359de
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,3 @@
{
"name": "InterfacesScripts"
}

View File

@@ -1,7 +1,6 @@
fileFormatVersion: 2
guid: 3ec4b51665a3e7b499aa9c64fc9c7462
folderAsset: yes
DefaultImporter:
guid: df9d7b70293a2e14d9d3a018c3956f7a
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 44a1fb926248fe240bed2d5c3820630b
guid: 97282ff3b465e3c4682d218b3819b2e8
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,12 @@
using System;
/// <summary>
/// Score class TODO: Move to separate file
/// </summary>
[Serializable]
public class Score
{
public int scoreValue;
public string time;
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ae746f332e314e84c9df74b892c75d4d
guid: 295706da5995d69468daf35ad5527089
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -148,7 +148,7 @@ GameObject:
- component: {fileID: 8299246693487308515}
- component: {fileID: 8299246693487308518}
- component: {fileID: 8299246693487308512}
- component: {fileID: 4155745828263815687}
- component: {fileID: 4518652150503380115}
m_Layer: 5
m_Name: ButtonBack
m_TagString: Untagged
@@ -229,10 +229,10 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4155745828263815687}
m_TargetAssemblyTypeName: ChangeSceneOnClick, Assembly-CSharp
m_MethodName: LoadScene
m_Mode: 5
- m_Target: {fileID: 4518652150503380115}
m_TargetAssemblyTypeName: BackButton, Assembly-CSharp
m_MethodName: Back
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
@@ -241,7 +241,7 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &4155745828263815687
--- !u!114 &4518652150503380115
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@@ -250,6 +250,6 @@ MonoBehaviour:
m_GameObject: {fileID: 8299246693487308514}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 949ba4da8595d52aebc98e6f9b6a405e, type: 3}
m_Script: {fileID: 11500000, guid: c3dd279b546423e4a8a1b28819a6c4a1, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@@ -280,7 +280,6 @@ GameObject:
- component: {fileID: 2823887524698191630}
- component: {fileID: 2823887524698191625}
- component: {fileID: 2823887524698191631}
- component: {fileID: 7528776122952476157}
- component: {fileID: 9192617418029337932}
m_Layer: 5
m_Name: ButtonUser
@@ -376,18 +375,6 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &7528776122952476157
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2823887524698191629}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 949ba4da8595d52aebc98e6f9b6a405e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &9192617418029337932
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@@ -285,7 +285,7 @@ GameObject:
- component: {fileID: 1441088452393136283}
- component: {fileID: 2691816296520610901}
m_Layer: 5
m_Name: Theme
m_Name: Theme Item
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

View File

@@ -189,7 +189,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &339096154
GameObject:
@@ -610,6 +610,7 @@ GameObject:
- component: {fileID: 906197777}
- component: {fileID: 906197779}
- component: {fileID: 906197778}
- component: {fileID: 906197780}
m_Layer: 5
m_Name: Panel
m_TagString: Untagged
@@ -636,6 +637,8 @@ RectTransform:
- {fileID: 955994878}
- {fileID: 507029407}
- {fileID: 1135894725}
- {fileID: 1774458253}
- {fileID: 1804488336}
m_Father: {fileID: 1768150806}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -682,6 +685,24 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 906197776}
m_CullTransparentMesh: 1
--- !u!114 &906197780
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 906197776}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4ee87f3cdcccf934b82f9531c90f3457, type: 3}
m_Name:
m_EditorClassIdentifier:
courseList: {fileID: 11400000, guid: a7ab583094b7897468bbca9243717608, type: 2}
userList: {fileID: 11400000, guid: 072bec636a40f7e4e93b0ac624a3bda2, type: 2}
title: {fileID: 1168097236}
description: {fileID: 1990031300}
courseImage: {fileID: 755030131}
progressBar: {fileID: 1135894726}
--- !u!1 &955994877
GameObject:
m_ObjectHideFlags: 0
@@ -767,10 +788,10 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1122939481}
m_TargetAssemblyTypeName: ChangeSceneOnClick, Assembly-CSharp
m_MethodName: LoadScene
m_Mode: 5
- m_Target: {fileID: 906197780}
m_TargetAssemblyTypeName: CourseActivityScreen, Assembly-CSharp
m_MethodName: StartCourse
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
@@ -893,50 +914,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 991775367}
m_CullTransparentMesh: 1
--- !u!1 &1122939480
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1122939482}
- component: {fileID: 1122939481}
m_Layer: 0
m_Name: SceneControl
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1122939481
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1122939480}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 949ba4da8595d52aebc98e6f9b6a405e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1122939482
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1122939480}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1135894724
GameObject:
m_ObjectHideFlags: 0
@@ -1162,56 +1139,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1168097234}
m_CullTransparentMesh: 1
--- !u!1 &1353360909
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1353360911}
- component: {fileID: 1353360910}
m_Layer: 0
m_Name: InfoControl
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1353360910
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1353360909}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4ee87f3cdcccf934b82f9531c90f3457, type: 3}
m_Name:
m_EditorClassIdentifier:
list: {fileID: 11400000, guid: a7ab583094b7897468bbca9243717608, type: 2}
userList: {fileID: 11400000, guid: 072bec636a40f7e4e93b0ac624a3bda2, type: 2}
title: {fileID: 1168097236}
description: {fileID: 1990031300}
courseImage: {fileID: 755030131}
slider: {fileID: 1135894726}
--- !u!4 &1353360911
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1353360909}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1023.27716, y: 547.95337, z: -1.0753342}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1768150802
GameObject:
m_ObjectHideFlags: 0
@@ -1305,10 +1232,8 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 906197777}
- {fileID: 1804488336}
- {fileID: 1774458253}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@@ -1320,7 +1245,7 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1768150806}
m_TransformParent: {fileID: 906197777}
m_Modifications:
- target: {fileID: 8299246693487308512, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
@@ -1340,7 +1265,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_RootOrder
value: 2
value: 7
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_AnchorMax.x
@@ -1426,8 +1351,12 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1768150806}
m_TransformParent: {fileID: 906197777}
m_Modifications:
- target: {fileID: 1935285004959629519, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2823887524698191629, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_Name
value: ButtonUser
@@ -1442,7 +1371,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2823887524698191630, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_RootOrder
value: 1
value: 8
objectReference: {fileID: 0}
- target: {fileID: 2823887524698191630, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchorMax.x
@@ -1516,6 +1445,26 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
--- !u!224 &1804488336 stripped
@@ -1535,7 +1484,7 @@ GameObject:
- component: {fileID: 1903244526}
- component: {fileID: 1903244525}
m_Layer: 5
m_Name: ControlsInfo
m_Name: Controls
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

View File

@@ -1204,6 +1204,10 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 906197777}
m_Modifications:
- target: {fileID: 1935285004959629519, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2823887524698191629, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_Name
value: ButtonUser
@@ -1296,6 +1300,26 @@ PrefabInstance:
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
value: Common/Scenes/StartScreen
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
--- !u!224 &1782112234 stripped

View File

@@ -343,10 +343,10 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1122939481}
m_TargetAssemblyTypeName: ChangeSceneOnClick, Assembly-CSharp
m_MethodName: LoadScene
m_Mode: 5
- m_Target: {fileID: 906197780}
m_TargetAssemblyTypeName: MainMenuScreen, Assembly-CSharp
m_MethodName: GotoMinigames
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
@@ -459,7 +459,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &519420028
GameObject:
@@ -1166,10 +1166,10 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1122939481}
m_TargetAssemblyTypeName: ChangeSceneOnClick, Assembly-CSharp
m_MethodName: LoadScene
m_Mode: 5
- m_Target: {fileID: 906197780}
m_TargetAssemblyTypeName: MainMenuScreen, Assembly-CSharp
m_MethodName: GotoSettings
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
@@ -1292,50 +1292,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 991775367}
m_CullTransparentMesh: 1
--- !u!1 &1122939480
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1122939482}
- component: {fileID: 1122939481}
m_Layer: 0
m_Name: SceneControl
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1122939481
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1122939480}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 949ba4da8595d52aebc98e6f9b6a405e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1122939482
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1122939480}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1369063653
GameObject:
m_ObjectHideFlags: 0
@@ -1497,7 +1453,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 906197780}
m_TargetAssemblyTypeName: StartScreenManager, Assembly-CSharp
m_TargetAssemblyTypeName: MainMenuScreen, Assembly-CSharp
m_MethodName: QuitApplication
m_Mode: 1
m_Arguments:
@@ -1631,10 +1587,10 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1122939481}
m_TargetAssemblyTypeName: ChangeSceneOnClick, Assembly-CSharp
m_MethodName: LoadScene
m_Mode: 5
- m_Target: {fileID: 906197780}
m_TargetAssemblyTypeName: MainMenuScreen, Assembly-CSharp
m_MethodName: GotoCourses
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
@@ -1851,7 +1807,7 @@ RectTransform:
m_Children:
- {fileID: 906197777}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}

View File

@@ -189,7 +189,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &143992426
PrefabInstance:
@@ -198,6 +198,10 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 906197777}
m_Modifications:
- target: {fileID: 1935285004959629519, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2823887524698191629, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_Name
value: ButtonUser
@@ -290,6 +294,26 @@ PrefabInstance:
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
value: Common/Scenes/StartScreen
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4001770636160324653, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
--- !u!224 &143992427 stripped
@@ -297,59 +321,6 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 2823887524698191630, guid: 53b0d00ac817ebf43b61bea2d160dd66, type: 3}
m_PrefabInstance: {fileID: 143992426}
m_PrefabAsset: {fileID: 0}
--- !u!1 &351832751
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 351832753}
- component: {fileID: 351832752}
m_Layer: 0
m_Name: InfoControl
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &351832752
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 351832751}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 90de9a5c57c2189429073f8aadc9e9b7, type: 3}
m_Name:
m_EditorClassIdentifier:
list: {fileID: 11400000, guid: 51453f9b41bc72f468ba3e67ab622f8f, type: 2}
title: {fileID: 1168097236}
description: {fileID: 1990031300}
gameImage: {fileID: 755030131}
button: {fileID: 955994879}
controls: {fileID: 915818721}
userList: {fileID: 11400000, guid: 072bec636a40f7e4e93b0ac624a3bda2, type: 2}
userContainer: {fileID: 507029407}
prefab: {fileID: 381012861935775045, guid: 154c17a838d2896499bd76d28a584222, type: 3}
--- !u!4 &351832753
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 351832751}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &507029406
GameObject:
m_ObjectHideFlags: 0
@@ -363,7 +334,7 @@ GameObject:
- component: {fileID: 507029408}
- component: {fileID: 507029410}
m_Layer: 5
m_Name: HighScoresTitle
m_Name: Highscores
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -681,6 +652,7 @@ GameObject:
- component: {fileID: 906197777}
- component: {fileID: 906197779}
- component: {fileID: 906197778}
- component: {fileID: 906197780}
m_Layer: 5
m_Name: Panel
m_TagString: Untagged
@@ -754,6 +726,27 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 906197776}
m_CullTransparentMesh: 1
--- !u!114 &906197780
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 906197776}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 90de9a5c57c2189429073f8aadc9e9b7, type: 3}
m_Name:
m_EditorClassIdentifier:
minigameList: {fileID: 11400000, guid: 51453f9b41bc72f468ba3e67ab622f8f, type: 2}
title: {fileID: 1168097236}
description: {fileID: 1990031300}
gameImage: {fileID: 755030131}
button: {fileID: 955994879}
controls: {fileID: 915818721}
userList: {fileID: 11400000, guid: 072bec636a40f7e4e93b0ac624a3bda2, type: 2}
userContainer: {fileID: 507029407}
prefab: {fileID: 381012861935775045, guid: 154c17a838d2896499bd76d28a584222, type: 3}
--- !u!1 &915818719
GameObject:
m_ObjectHideFlags: 0
@@ -766,7 +759,7 @@ GameObject:
- component: {fileID: 915818722}
- component: {fileID: 915818721}
m_Layer: 5
m_Name: ControlsInfo
m_Name: Controls
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -902,7 +895,7 @@ GameObject:
- component: {fileID: 955994880}
- component: {fileID: 955994879}
m_Layer: 5
m_Name: PlayButton
m_Name: Play Button
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -1088,50 +1081,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 991775367}
m_CullTransparentMesh: 1
--- !u!1 &1122939480
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1122939482}
- component: {fileID: 1122939481}
m_Layer: 0
m_Name: SceneControl
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1122939481
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1122939480}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 949ba4da8595d52aebc98e6f9b6a405e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1122939482
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1122939480}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1168097234
GameObject:
m_ObjectHideFlags: 0
@@ -1467,7 +1416,7 @@ RectTransform:
m_Children:
- {fileID: 906197777}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}

View File

@@ -706,7 +706,7 @@ MonoBehaviour:
m_GameObject: {fileID: 1768150802}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 68caaa5508a4d40448b47630ff86f035, type: 3}
m_Script: {fileID: 11500000, guid: 30d9f9130bf1d414aaad006b2177bdea, type: 3}
m_Name:
m_EditorClassIdentifier:
themePrefab: {fileID: 1441088452393136277, guid: 67febbbd89041e243b4e201a9f8d91e9, type: 3}

View File

@@ -0,0 +1,15 @@
using UnityEngine;
/// <summary>
/// Script managing the default 'back'-button action
/// </summary>
public class BackButton : MonoBehaviour
{
/// <summary>
/// The default 'back'-button action: go back to the previous scene
/// </summary>
public void Back()
{
SystemController.GetInstance().BackToPreviousScene();
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a85f8bd9399680347b4be72850a56fcf
guid: c3dd279b546423e4a8a1b28819a6c4a1
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,12 +1,11 @@
using System.Collections;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
/// <summary>
/// Authorize and check for available webcam(s)
/// </summary>
public class WebcamAuthorization : MonoBehaviour
public class BootScreen : MonoBehaviour
{
/// <summary>
/// UI Reference to the text object to display an error message
@@ -24,7 +23,7 @@ public class WebcamAuthorization : MonoBehaviour
{
if (0 < WebCamTexture.devices.Length)
{
SceneManager.LoadScene("Common/Scenes/StartScreen");
SystemController.GetInstance().SwapScene("Common/Scenes/MainMenuScreen");
}
else
{

View File

@@ -1,35 +0,0 @@
using UnityEngine;
using UnityEngine.SceneManagement;
/// <summary>
/// Class to handle scene loading callbacks
/// </summary>
public class ChangeSceneOnClick : MonoBehaviour
{
/// <summary>
/// Method used as callback for gameobject onClick events
/// </summary>
/// <param name="sceneName">The path to the new scene (<c>path == $"Assets/{sceneName}"</c>)</param>
public void LoadScene(string sceneName)
{
SceneManager.LoadScene(sceneName);
}
/// <summary>
/// Method used as callback for gameobject onClick events
/// </summary>
/// <param name="scene">Reference to a scene</param>
public void LoadScene(Scene scene)
{
SceneManager.LoadScene(scene.buildIndex);
}
/// <summary>
/// Method used as callback from gameobject onClick events
/// </summary>
/// <param name="buildIndex">Build index of the scene to be loaded</param>
public void LoadScene(int buildIndex)
{
SceneManager.LoadScene(buildIndex);
}
}

View File

@@ -0,0 +1,19 @@
{
"name": "CommonScripts",
"rootNamespace": "",
"references": [
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:63c63e721f65ebb7d871cb9ef49f4752",
"GUID:1631ed2680c61245b8211d943c1639a8",
"GUID:df9d7b70293a2e14d9d3a018c3956f7a"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -1,7 +1,6 @@
fileFormatVersion: 2
guid: 4a55a1703b7efe449be66773a42e7ff0
folderAsset: yes
DefaultImporter:
guid: 3444c67d5a3a93e5a95a48906078c372
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:

View File

@@ -1,18 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using TMPro; // For text
/// <summary>
/// Manager infopage for the Courses
/// </summary>
public class InfoCourse : MonoBehaviour
public class CourseActivityScreen : MonoBehaviour
{
/// <summary>
/// Reference to the courses
/// </summary>
public CourseList list;
public CourseList courseList;
// private float maxvalue; In case we want to change progress e.g. amount of words correct, then change maxvalue amount of words etc.
/// <summary>
@@ -43,17 +41,15 @@ public class InfoCourse : MonoBehaviour
/// <summary>
/// Progress bar Display
/// </summary>
public Slider slider;
// Start is called before the first frame update
public Slider progressBar;
/// <summary>
/// Sets the infopage for a given course
/// </summary>
void Start()
{
int index = list.currentCourseIndex;
Course course = list.courses[index];
int index = courseList.currentCourseIndex;
Course course = courseList.courses[index];
title.text = course.title;
description.text = course.description;
@@ -63,9 +59,16 @@ public class InfoCourse : MonoBehaviour
// Set progress
progress = userList.GetCurrentUser().GetCourseProgress(course.index);
if (progress != null)
slider.value = progress.Get<float>("courseProgress");
progressBar.value = progress.Get<float>("courseProgress");
else
slider.value = 0.0f;
progressBar.value = 0.0f;
}
/// <summary>
/// Callback to start the course
/// </summary>
public void StartCourse()
{
SystemController.GetInstance().LoadNextScene("Courses/Scenes/TemplateCourse");
}
}

View File

@@ -1,6 +1,5 @@
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
/// <summary>
@@ -68,6 +67,6 @@ public class CourseItem : MonoBehaviour
slider.GetComponent<Slider>().value = progress;
// Add click functionality
button.onClick.AddListener(() => SceneManager.LoadScene("Common/Scenes/InfoCourse"));
button.onClick.AddListener(() => SystemController.GetInstance().LoadNextScene("Common/Scenes/CourseActivityScreen"));
}
}

View File

@@ -1,10 +1,9 @@
using UnityEngine;
using UnityEngine.SceneManagement;
/// <summary>
/// ListCourseScreen scene manager
/// </summary>
public class CourseListManager : MonoBehaviour
public class ListCoursesScreen : MonoBehaviour
{
/// <summary>
/// Reference to the course-list container object
@@ -40,9 +39,8 @@ public class CourseListManager : MonoBehaviour
/// <summary>
/// Method used as callback for course item onClick events
/// </summary>
/// <param name="sceneName">The path to the new scene (<c>path == $"Assets/{sceneName}"</c>)</param>
public void LoadScene(string sceneName)
public void GotoCourseInfo()
{
SceneManager.LoadScene(sceneName);
SystemController.GetInstance().LoadNextScene("Common/Scenes/CourseActivityScreen");
}
}

View File

@@ -1,10 +1,9 @@
using UnityEngine;
using UnityEngine.SceneManagement;
/// <summary>
/// ListMinigameScreen scene manager
/// </summary>
public class MinigameListManager : MonoBehaviour
public class ListMinigamesScreen : MonoBehaviour
{
/// <summary>
/// Reference to minigame-list container object
@@ -43,6 +42,6 @@ public class MinigameListManager : MonoBehaviour
/// <param name="sceneName">The path to the new scene (<c>path == $"Assets/{sceneName}"</c>)</param>
public void LoadScene(string sceneName)
{
SceneManager.LoadScene(sceneName);
SystemController.GetInstance().LoadNextScene(sceneName);
}
}

View File

@@ -0,0 +1,57 @@
using System.IO;
using UnityEngine;
/// <summary>
/// StartScreen scene manager
/// </summary>
public class MainMenuScreen : MonoBehaviour
{
/// <summary>
/// Referece to the userlist to check whether an user account is present
/// </summary>
public UserList userList;
/// <summary>
/// Check on load whether a user is already present,
/// if not load the UserCreationScreen scene so the user can create a new account
/// </summary>
void Awake()
{
if (!File.Exists(UserList.PATH) || userList.GetUsers().Count <= 0)
{
SystemController.GetInstance().LoadNextScene("Accounts/Scenes/UserCreationScreen");
}
}
/// <summary>
/// Quit the application
/// </summary>
public void QuitApplication()
{
Application.Quit();
}
/// <summary>
/// Load the `CoursesMenuScreen` scene
/// </summary>
public void GotoCourses()
{
SystemController.GetInstance().LoadNextScene("Common/Scenes/CoursesMenuScreen");
}
/// <summary>
/// Load the `ListMinigamesScreen` scene
/// </summary>
public void GotoMinigames()
{
SystemController.GetInstance().LoadNextScene("Common/Scenes/ListMinigamesScreen");
}
/// <summary>
/// Load the `SettingsScreen` scene
/// </summary>
public void GotoSettings()
{
SystemController.GetInstance().LoadNextScene("Common/Scenes/SettingsScreen");
}
}

View File

@@ -21,6 +21,11 @@ public class Minigame : ScriptableObject
/// </summary>
public string description;
/// <summary>
/// Whether or not the game needs a theme to be selected
/// </summary>
public bool needsTheme;
/// <summary>
/// Reference to the minigame thumbnail
/// </summary>
@@ -35,5 +40,4 @@ public class Minigame : ScriptableObject
/// An explanation on how to play the game and score points
/// </summary>
public string controls;
}

View File

@@ -1,23 +1,19 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using static GameController;
/// <summary>
/// Manager infopage for the Minigames
/// </summary>
public class InfoMinigame : MonoBehaviour
public class MinigameActivityScreen : MonoBehaviour
{
/// <summary>
/// Reference to the Minigames
/// </summary>
public MinigameList list;
public MinigameList minigameList;
/// <summary>
/// Title Display
@@ -44,8 +40,6 @@ public class InfoMinigame : MonoBehaviour
/// </summary>
public TMP_Text controls;
// Scores for each user
/// <summary>
/// Reference to the users
/// </summary>
@@ -66,7 +60,6 @@ public class InfoMinigame : MonoBehaviour
/// </summary>
public GameObject prefab;
// Start is called before the first frame update
/// <summary>
/// Sets the infopage for a given minigame
/// </summary>
@@ -82,17 +75,24 @@ public class InfoMinigame : MonoBehaviour
private void GenerateContent()
{
// Get current minigame
int index = list.currentMinigameIndex;
Minigame minigame = list.minigames[index];
int index = minigameList.currentMinigameIndex;
Minigame minigame = minigameList.minigames[index];
// Set main screen
title.text = minigame.title;
description.text = minigame.description;
gameImage.sprite = minigame.thumbnail;
controls.text = minigame.controls;
// Add click functionality
button.onClick.AddListener(() => SceneManager.LoadScene(minigame.minigameEntryPoint));
// Add click
if (minigame.needsTheme)
{
button.onClick.AddListener(() => SystemController.GetInstance().LoadNextScene("Common/Scenes/ThemeSelectionScreen"));
}
else
{
button.onClick.AddListener(() => SystemController.GetInstance().LoadNextScene(minigame.minigameEntryPoint));
}
}
/// <summary>
@@ -104,8 +104,8 @@ public class InfoMinigame : MonoBehaviour
private void GenerateHighScores()
{
// Get current minigame
int index = list.currentMinigameIndex;
Minigame minigame = list.minigames[index];
int index = minigameList.currentMinigameIndex;
Minigame minigame = minigameList.minigames[index];
List<Tuple<string, Sprite, Score>> allScores = new List<Tuple<string, Sprite, Score>>();
foreach (User user in userList.GetUsers())
@@ -137,7 +137,6 @@ public class InfoMinigame : MonoBehaviour
instance.transform.Find("Title").GetComponent<TMP_Text>().text = username;
instance.transform.Find("Avatar").GetComponent<Image>().sprite = sprite;
instance.transform.Find("Score").GetComponent<TMP_Text>().text = score.scoreValue.ToString();
}
}
}

View File

@@ -1,6 +1,5 @@
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
/// <summary>
@@ -47,6 +46,10 @@ public class MinigameItem : MonoBehaviour
title.text = minigame.title;
// Add click functionality
button.onClick.AddListener(() => SceneManager.LoadScene("Common/Scenes/InfoMinigame"));
button.onClick.AddListener(() =>
{
PlayerPrefs.SetString("gamePath", minigame.minigameEntryPoint);
SystemController.GetInstance().LoadNextScene("Common/Scenes/MinigameActivityScreen");
});
}
}

View File

@@ -1,31 +0,0 @@
using System.IO;
using UnityEngine;
using UnityEngine.SceneManagement;
/// <summary>
/// StartScreen scene manager
/// </summary>
public class StartScreenManager : MonoBehaviour
{
/// <summary>
/// Referece to the userlist to check whether an user account is present
/// </summary>
public UserList userList;
/// <summary>
/// Check on load whether a user is already present,
/// if not load the UserCreationScreen scene so the user can create a new account
/// </summary>
void Awake()
{
if (!File.Exists(UserList.PATH) || userList.GetUsers().Count <= 0)
{
SceneManager.LoadScene("Accounts/Scenes/UserCreationScreen");
}
}
public void QuitApplication()
{
Application.Quit();
}
}

View File

@@ -0,0 +1,36 @@
using UnityEngine;
/// <summary>
/// JSON structure containing all themes/words
/// </summary>
[System.Serializable]
public class ThemeList
{
public Theme[] themes;
}
/// <summary>
/// Object representing part of the JSON containing word data
/// </summary>
[System.Serializable]
public class Theme
{
public string name;
public string description;
public string[] words;
}
/// <summary>
/// Loader of the themes-JSON
/// </summary>
public class ThemeLoader : MonoBehaviour
{
/// <summary>
/// Loads the JSON file containing all of the themes
/// </summary>
public static ThemeList LoadJson()
{
TextAsset themeJson = Resources.Load<TextAsset>("Common/words");
return JsonUtility.FromJson<ThemeList>(themeJson.text);
}
}

View File

@@ -1,16 +1,24 @@
using UnityEngine;
using UnityEngine.SceneManagement;
public class ThemeSelectionController : MonoBehaviour
/// <summary>
/// ThemeSelectionScreen scene manager
/// </summary>
public class ThemeSelectionScreen : MonoBehaviour
{
[Header("Theme Selection")]
// Theme prefab
/// <summary>
/// Theme prefab
/// </summary>
public GameObject themePrefab;
// Reference to container holding all theme-buttons
/// <summary>
/// Reference to container holding all theme-buttons
/// </summary>
public Transform themesContainer;
public void Start()
/// <summary>
/// Start is called before the first frame update
/// </summary>
void Start()
{
// TODO: change to ScriptableObject
ThemeList themeList = ThemeLoader.LoadJson();
@@ -30,9 +38,13 @@ public class ThemeSelectionController : MonoBehaviour
}
}
/// <summary>
/// Load the game with a specified theme
/// </summary>
/// <param name="clickedTheme">Name of the clicked theme</param>
public void OnButtonClick(string clickedTheme)
{
PlayerPrefs.SetString("themeName", clickedTheme);
SceneManager.LoadScene("Game");
SystemController.GetInstance().SwapScene(PlayerPrefs.GetString("gamePath"));
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 74f8b297e568e071198f12d32c3f32c0
guid: 30d9f9130bf1d414aaad006b2177bdea
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,6 +1,5 @@
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
/// <summary>
@@ -44,7 +43,7 @@ public class UserButton : MonoBehaviour
/// </summary>
public void OpenProgressCallback()
{
SceneManager.LoadScene("Accounts/Scenes/UserProgressScreen");
SystemController.GetInstance().LoadNextScene("Accounts/Scenes/UserProgressScreen");
}
/// <summary>
@@ -52,7 +51,7 @@ public class UserButton : MonoBehaviour
/// </summary>
public void ChangeUserCallback()
{
SceneManager.LoadScene("Accounts/Scenes/ChangeUserScreen");
SystemController.GetInstance().LoadNextScene("Accounts/Scenes/ChangeUserScreen");
}
/// <summary>

View File

@@ -394,61 +394,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100123244}
m_CullTransparentMesh: 1
--- !u!1 &118887548
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 118887550}
- component: {fileID: 118887549}
m_Layer: 0
m_Name: Button-controller
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &118887549
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 118887548}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ae746f332e314e84c9df74b892c75d4d, type: 3}
m_Name:
m_EditorClassIdentifier:
player: {fileID: 993952931}
button: {fileID: 1159630774}
pauseSprite: {fileID: 21300000, guid: 43db869a07cf51f45a411b6e4a417743, type: 3}
wordImage: {fileID: 2145235737}
title: {fileID: 388014849}
userList: {fileID: 11400000, guid: 072bec636a40f7e4e93b0ac624a3bda2, type: 2}
courselist: {fileID: 11400000, guid: a7ab583094b7897468bbca9243717608, type: 2}
ResultPanel: {fileID: 1383144366}
CoursesButton: {fileID: 839294691}
Webcam: {fileID: 1485779445}
timeSpent: {fileID: 77614869}
--- !u!4 &118887550
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 118887548}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &301088547
GameObject:
m_ObjectHideFlags: 0
@@ -460,6 +405,7 @@ GameObject:
- component: {fileID: 301088548}
- component: {fileID: 301088550}
- component: {fileID: 301088549}
- component: {fileID: 301088551}
m_Layer: 5
m_Name: Panel
m_TagString: Untagged
@@ -480,12 +426,12 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2145235736}
- {fileID: 414055543}
- {fileID: 1493108463}
- {fileID: 378145455}
- {fileID: 1343151409}
- {fileID: 1813638489}
- {fileID: 409590586}
- {fileID: 1335886460}
m_Father: {fileID: 1559094126}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -532,6 +478,32 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 301088547}
m_CullTransparentMesh: 0
--- !u!114 &301088551
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 301088547}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6b3f784c065813a4a8364b1299284816, type: 3}
m_Name:
m_EditorClassIdentifier:
webcamDisplay: {fileID: 378145456}
feedback: {fileID: 409590587}
feedbackPopup: {fileID: 1374011069}
dynamic: {fileID: 1523390682}
player: {fileID: 993952931}
button: {fileID: 1159630774}
pauseSprite: {fileID: 21300000, guid: 43db869a07cf51f45a411b6e4a417743, type: 3}
wordImage: {fileID: 2145235737}
title: {fileID: 388014849}
userList: {fileID: 11400000, guid: 072bec636a40f7e4e93b0ac624a3bda2, type: 2}
courselist: {fileID: 11400000, guid: a7ab583094b7897468bbca9243717608, type: 2}
ResultPanel: {fileID: 1383144366}
CoursesButton: {fileID: 839294691}
timeSpent: {fileID: 77614869}
--- !u!1 &361280475
GameObject:
m_ObjectHideFlags: 0
@@ -749,7 +721,7 @@ GameObject:
- component: {fileID: 378145457}
- component: {fileID: 378145456}
m_Layer: 5
m_Name: Webcam-bg
m_Name: Webcam Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -768,7 +740,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 301088548}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -822,7 +794,7 @@ GameObject:
- component: {fileID: 388014850}
- component: {fileID: 388014849}
m_Layer: 5
m_Name: title
m_Name: Title
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -960,7 +932,7 @@ GameObject:
- component: {fileID: 409590588}
- component: {fileID: 409590587}
m_Layer: 5
m_Name: Test-feedback-button
m_Name: Feedback Button
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -980,7 +952,7 @@ RectTransform:
m_Children:
- {fileID: 1138468890}
m_Father: {fileID: 301088548}
m_RootOrder: 6
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -1031,9 +1003,9 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1485779445}
m_TargetAssemblyTypeName: Webcam, Assembly-CSharp
m_MethodName: Show_feedback
- m_Target: {fileID: 301088551}
m_TargetAssemblyTypeName: TemplateCourse, Assembly-CSharp
m_MethodName: ShowFeedback
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
@@ -1081,140 +1053,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 409590585}
m_CullTransparentMesh: 1
--- !u!1 &414055542
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 414055543}
- component: {fileID: 414055546}
- component: {fileID: 414055545}
- component: {fileID: 414055544}
m_Layer: 5
m_Name: Courses
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &414055543
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 414055542}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1785847568}
m_Father: {fileID: 301088548}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 234, y: -60}
m_SizeDelta: {x: 480.0704, y: 99.1845}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &414055544
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 414055542}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 414055545}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1485779445}
m_TargetAssemblyTypeName: Webcam, Assembly-CSharp
m_MethodName: LoadScene
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: CoursesScreen
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &414055545
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 414055542}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &414055546
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 414055542}
m_CullTransparentMesh: 1
--- !u!1 &519420028
GameObject:
m_ObjectHideFlags: 0
@@ -1518,13 +1356,13 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName:
m_MethodName:
- m_Target: {fileID: 301088551}
m_TargetAssemblyTypeName: TemplateCourse, Assembly-CSharp
m_MethodName: Back
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName:
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
@@ -2130,7 +1968,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 118887549}
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: StartPause, Assembly-CSharp
m_MethodName: Pause
m_Mode: 1
@@ -2256,6 +2094,120 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1300721216}
m_CullTransparentMesh: 1
--- !u!1001 &1335886459
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 301088548}
m_Modifications:
- target: {fileID: 8299246693487308512, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 301088551}
- target: {fileID: 8299246693487308512, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: Back
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308512, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: TemplateCourse, Assembly-CSharp
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308514, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_Name
value: ButtonBack
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_Pivot.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_SizeDelta.x
value: 300
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_SizeDelta.y
value: 120
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
--- !u!224 &1335886460 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
m_PrefabInstance: {fileID: 1335886459}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1343151408
GameObject:
m_ObjectHideFlags: 0
@@ -2269,7 +2221,7 @@ GameObject:
- component: {fileID: 1343151411}
- component: {fileID: 1343151410}
m_Layer: 5
m_Name: Change-cam
m_Name: Change Webcam Button
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -2289,7 +2241,7 @@ RectTransform:
m_Children:
- {fileID: 1898926705}
m_Father: {fileID: 301088548}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -2340,8 +2292,8 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1485779445}
m_TargetAssemblyTypeName: Webcam, Assembly-CSharp
- m_Target: {fileID: 301088551}
m_TargetAssemblyTypeName: TemplateCourse, Assembly-CSharp
m_MethodName: SwapCam
m_Mode: 1
m_Arguments:
@@ -2402,7 +2354,7 @@ GameObject:
- component: {fileID: 1374011072}
- component: {fileID: 1374011071}
m_Layer: 5
m_Name: Panel
m_Name: Feedback
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -2701,54 +2653,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1427866734}
m_CullTransparentMesh: 1
--- !u!1 &1485779444
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1485779446}
- component: {fileID: 1485779445}
m_Layer: 0
m_Name: Webcam-controller
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1485779445
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1485779444}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a85f8bd9399680347b4be72850a56fcf, type: 3}
m_Name:
m_EditorClassIdentifier:
display: {fileID: 378145456}
feedback: {fileID: 409590587}
popup: {fileID: 1374011069}
dynamic: {fileID: 1523390682}
--- !u!4 &1485779446
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1485779444}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1493108462
GameObject:
m_ObjectHideFlags: 0
@@ -2761,7 +2665,7 @@ GameObject:
- component: {fileID: 1493108465}
- component: {fileID: 1493108464}
m_Layer: 5
m_Name: video-bg
m_Name: Video Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -2781,7 +2685,7 @@ RectTransform:
m_Children:
- {fileID: 1159630773}
m_Father: {fileID: 301088548}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -3199,141 +3103,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1773033262}
m_CullTransparentMesh: 1
--- !u!1 &1785847567
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1785847568}
- component: {fileID: 1785847570}
- component: {fileID: 1785847569}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1785847568
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1785847567}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 414055543}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0.00024414062}
m_SizeDelta: {x: 0, y: 0.00048828}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1785847569
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1785847567}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: < Back to courses
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4281479730
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 48
m_fontSizeBase: 48
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &1785847570
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1785847567}
m_CullTransparentMesh: 1
--- !u!1 &1813638488
GameObject:
m_ObjectHideFlags: 0
@@ -3347,7 +3116,7 @@ GameObject:
- component: {fileID: 1813638491}
- component: {fileID: 1813638490}
m_Layer: 5
m_Name: Next-sign-button
m_Name: Next Sign Button
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -3367,7 +3136,7 @@ RectTransform:
m_Children:
- {fileID: 1427866735}
m_Father: {fileID: 301088548}
m_RootOrder: 5
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -3418,8 +3187,8 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 118887549}
m_TargetAssemblyTypeName: StartPause, Assembly-CSharp
- m_Target: {fileID: 301088551}
m_TargetAssemblyTypeName: TemplateCourse, Assembly-CSharp
m_MethodName: NextSign
m_Mode: 1
m_Arguments:
@@ -3617,7 +3386,7 @@ GameObject:
- component: {fileID: 2145235738}
- component: {fileID: 2145235737}
m_Layer: 5
m_Name: Tutorial-image-bg
m_Name: Learnable Sprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

View File

@@ -0,0 +1,18 @@
{
"name": "CourseScripts",
"rootNamespace": "",
"references": [
"Unity.TextMeshPro",
"AccountsScripts",
"InterfacesScripts"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 63c63e721f65ebb7d871cb9ef49f4752
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -5,11 +5,39 @@ using UnityEngine.UI;
using UnityEngine.Video;
/// <summary>
/// This class is responsible for loading all data from the Course-scriptableobject.
/// Specifically it fetches and displays the correct title, videos and images while also keeping track of the progress.
/// TemplateCourse scene manager
/// </summary>
public class StartPause : MonoBehaviour
public class TemplateCourse : MonoBehaviour
{
/// <summary>
/// Index to indicate which camera is being used
/// </summary>
private int camdex = 0;
/// <summary>
/// This texture is used as an intermidiary between the camera output and the display image
/// </summary>
private WebCamTexture tex;
/// <summary>
/// Reference to the RawImage that will display the video
/// </summary>
public RawImage webcamDisplay;
/// <summary>
/// Reference to the button that is currently used to test the feedback-display
/// </summary>
public Button feedback;
/// <summary>
/// This is a reference to the PANEL that holds the feedbackwindow
/// </summary>
public GameObject feedbackPopup;
/// <summary>
/// This is a reference to the textfield that holds the part of the feedback-window that will change: bad/good/excellent
/// </summary>
public TMP_Text dynamic;
/// <summary>
/// Reference to instructional video player
@@ -19,22 +47,21 @@ public class StartPause : MonoBehaviour
/// Reference to pause button
/// </summary>
public Button button;
/// <summary>
/// Reference to sprite for the pause button
/// </summary>
public Sprite pauseSprite;
/// <summary>
/// Reference to the image for displaying the current words sprite
/// </summary>
public Image wordImage;
/// <summary>
/// Reference to the text object for displaying the current word
/// </summary>
public TextMeshProUGUI title;
public TMP_Text title;
/// <summary>
/// Reference to user list to get current user
@@ -45,29 +72,27 @@ public class StartPause : MonoBehaviour
/// The current user
/// </summary>
private User user;
/// <summary>
/// Current user progress for this course
/// </summary>
private Progress progress = null;
/// <summary>
/// ScriptableObject with list of all courses
/// </summary>
public CourseList courselist;
/// <summary>
/// Reference to Course ScriptableObject
/// </summary>
private Course course;
/// <summary>
/// Index of the current word/letter in the course.learnables list
/// </summary>
private int currentWordIndex = 0;
/// <summary>
/// This holds the amount of words in the course
/// </summary>
@@ -89,11 +114,6 @@ public class StartPause : MonoBehaviour
/// </summary>
public Button CoursesButton;
/// <summary>
/// Webcam class to close the webcam when the course is finished
/// </summary>
public Webcam Webcam;
/// <summary>
/// DateTime containint the start moment
/// </summary>
@@ -102,16 +122,28 @@ public class StartPause : MonoBehaviour
/// <summary>
/// Reference to the timeSpent UI
/// </summary>
public TextMeshProUGUI timeSpent;
public TMP_Text timeSpent;
/// <summary>
/// This function is called when the script is initialised.
/// It inactivatis the popup, finds a webcam to use and links it via the WebcamTexture to the display RawImage.
/// It takes the correct course from the courselist, using the courseIndex.
/// Then it checks whether or not the User has started the course yet, to possibly create a new progress atribute for the course.
/// Then it sets up the course-screen to display relevant information from the course-scriptable.
/// </summary>
public void Awake()
void Awake()
{
// Setting up Webcam
feedbackPopup.SetActive(false);
if (WebCamTexture.devices.Length > 0)
{
WebCamDevice device = WebCamTexture.devices[camdex];
tex = new WebCamTexture(device.name);
webcamDisplay.texture = tex;
tex.Play();
}
// Setting up course
course = courselist.courses[courselist.currentCourseIndex];
maxWords = course.learnables.Count;
@@ -140,7 +172,6 @@ public class StartPause : MonoBehaviour
startMoment = DateTime.Now;
}
// These two functions generate video and image from files
/// <summary>
/// This function uses the word_i integer to grab the correct video from the course.learnabels.
/// When it has this video, it will load it into the videoplayer and set it to start.
@@ -190,7 +221,6 @@ public class StartPause : MonoBehaviour
}
}
// Press next-sign button for next word
/// <summary>
/// This function is called when the next-sign button is pressed.
/// It increased the wordindex and fetches new videos/images if index<max, because then the coure is not fincished yet.
@@ -222,7 +252,6 @@ public class StartPause : MonoBehaviour
}
}
/// <summary>
/// finishcourse is called to save the "finished" progress to the user.
/// </summary>
@@ -236,10 +265,78 @@ public class StartPause : MonoBehaviour
timeSpent.text = time.ToString(@"hh\:mm\:ss");
// Link button
//CoursesButton.onClick.AddListener(() => { SceneManager.LoadScene("Assets/Common/Scenes/CoursesScreen.unity"); });
CoursesButton.onClick.AddListener(() => { Webcam.LoadScene("Assets/Common/Scenes/CoursesScreen.unity"); });
CoursesButton.onClick.AddListener(() => { SystemController.GetInstance().BackToPreviousScene(); });
progress.AddOrUpdate<float>("courseProgress", 1f);
userList.Save();
}
/// <summary>
/// So long as there are cameras to use, you swap the camera you are using to another in the list.
/// </summary>
public void SwapCam()
{
if (WebCamTexture.devices.Length > 0)
{
// Stop the old camera
// If there was no camera playing before, then you dont have to reset the texture, as it wasn't assigned in the first place.
if (tex.isPlaying)
{
webcamDisplay.texture = null;
tex.Stop();
tex = null;
}
// Find the new camera
camdex += 1;
camdex %= WebCamTexture.devices.Length;
// Start the new camera
WebCamDevice device = WebCamTexture.devices[camdex];
tex = new WebCamTexture(device.name);
webcamDisplay.texture = tex;
tex.Play();
}
}
/// <summary>
/// The normal sceneChanger cannot be used here since the camera also needs to be stopped.
/// This extra functionality is implemented in this function
/// </summary>
/// <param name="sceneName"> The path for the scene you want to travel to, assuming root-directory is Assets</param>
public void Back()
{
webcamDisplay.texture = null;
tex.Stop();
tex = null;
SystemController.GetInstance().BackToPreviousScene();
}
/// <summary>
/// This function toggles between inactivity and activity for the popup panel.
/// This will be changed later when the model gets integrated, probably being timed to dissapear.
/// </summary>
public void ShowFeedback()
{
if (feedbackPopup.activeSelf)
{
dynamic.text = "";
feedbackPopup.SetActive(false);
return;
}
double index = UnityEngine.Random.value;
if (index < 0.5)
{
dynamic.text = "Poor";
}
else if (index > 0.8)
{
dynamic.text = "Excellent";
}
else
{
dynamic.text = "Good";
}
feedbackPopup.SetActive(true);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6b3f784c065813a4a8364b1299284816
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,128 +0,0 @@
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
/// <summary>
/// This class is dedicated to the camera and other actions that later could be connected to it, like the feedback.
/// It is responsible for finding working cameras, displaying them and being able to toggle between them.
/// This class also holds temporary code to display feedback via a button.
/// </summary>
public class Webcam : MonoBehaviour
{
/// <summary>
/// Index to indicate which camera is being used
/// </summary>
int camdex = 0;
/// <summary>
/// This texture is used as an intermidiary between the camera output and the display image
/// </summary>
WebCamTexture tex;
/// <summary>
/// Reference to the RawImage that will display the video
/// </summary>
public RawImage display;
/// <summary>
/// Reference to the button that is currently used to test the feedback-display
/// </summary>
public Button feedback;
/// <summary>
/// This is a reference to the PANEL that holds the feedbackwindow
/// </summary>
public GameObject popup;
/// <summary>
/// This is a reference to the textfield that holds the part of the feedback-window that will change: bad/good/excellent
/// </summary>
public TextMeshProUGUI dynamic;
/// <summary>
/// This function is called at the start of the frame.
/// It inactivatis the popup, finds a webcam to use and links it via the WebcamTexture to the display RawImage.
/// </summary>
void Awake()
{
popup.SetActive(false);
if (WebCamTexture.devices.Length > 0) {
WebCamDevice device = WebCamTexture.devices[camdex];
tex = new WebCamTexture(device.name);
display.texture = tex;
tex.Play();
}
}
/// <summary>
/// So long as there are cameras to use, you swap the camera you are using to another in the list.
/// </summary>
public void SwapCam()
{
if (WebCamTexture.devices.Length > 0)
{
// Stop the old camera
// If there was no camera playing before, then you dont have to reset the texture, as it wasn't assigned in the first place.
if (tex.isPlaying) {
display.texture = null;
tex.Stop();
tex = null;
}
// Find the new camera
camdex += 1;
camdex %= WebCamTexture.devices.Length;
// Start the new camera
WebCamDevice device = WebCamTexture.devices[camdex];
tex = new WebCamTexture(device.name);
display.texture = tex;
tex.Play();
}
}
/// <summary>
/// The normal sceneChanger cannot be used here since the camera also needs to be stopped.
/// This extra functionality is implemented in this function
/// </summary>
/// <param name="sceneName"> The path for the scene you want to travel to, assuming root-directory is Assets</param>
public void LoadScene(string sceneName)
{
display.texture = null;
tex.Stop();
tex = null;
SceneManager.LoadScene(sceneName);
}
/// <summary>
/// This function toggles between inactivity and activity for the popup panel.
/// This will be changed later when the model gets integrated, probably being timed to dissapear.
/// </summary>
public void Show_feedback()
{
if (popup.activeSelf)
{
dynamic.text = "";
popup.SetActive(false);
return;
}
double index = UnityEngine.Random.value;
if (index < 0.5)
{
dynamic.text = "Poor";
}
else if (index > 0.8)
{
dynamic.text = "Excellent";
}
else
{
dynamic.text = "Good";
}
popup.SetActive(true);
}
}

View File

@@ -1,11 +0,0 @@
using NUnit.Framework;
public class BasicTest
{
// check if edit mode tests works
[Test]
public void AlwaysTrueTest()
{
Assert.True(true);
}
}

View File

@@ -1,9 +0,0 @@
{
"name": "EditModeTests",
"optionalUnityReferences": [
"TestAssemblies"
],
"includePlatforms": [
"Editor"
]
}

View File

@@ -0,0 +1,21 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d7809d135a59849458ccb29ffad535c5, type: 3}
m_Name: JustSign
m_EditorClassIdentifier:
index: 2
title: Just Sign
description: A rhythm game
needsTheme: 1
thumbnail: {fileID: 0}
minigameEntryPoint: JustSign/Scenes/Game
controls: test

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e726e0b93ea88465db7ee27605deb83f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -324,7 +324,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &519420028
GameObject:
@@ -1111,7 +1111,7 @@ PrefabInstance:
m_Modifications:
- target: {fileID: 8299246693487308512, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 5
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308512, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
@@ -1119,7 +1119,7 @@ PrefabInstance:
objectReference: {fileID: 1537631145}
- target: {fileID: 8299246693487308512, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: LoadScene
value: GotoThemeSelection
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308512, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
@@ -1127,7 +1127,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308512, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
value: SpellingBee/Scenes/ThemeSelection
value: Common/Scenes/ThemeSelection
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308514, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_Name
@@ -1143,7 +1143,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_RootOrder
value: 6
value: 5
objectReference: {fileID: 0}
- target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3}
propertyPath: m_AnchorMax.x
@@ -2181,50 +2181,6 @@ MonoBehaviour:
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &1122939480
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1122939482}
- component: {fileID: 1122939481}
m_Layer: 0
m_Name: SceneControl
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1122939481
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1122939480}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 949ba4da8595d52aebc98e6f9b6a405e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1122939482
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1122939480}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1172084826
GameObject:
m_ObjectHideFlags: 0
@@ -3135,19 +3091,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1346891279}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName:
m_MethodName:
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName:
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_Calls: []
--- !u!114 &1346891279
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -3777,7 +3721,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
display: {fileID: 588634507}
dynamic: {fileID: 0}
--- !u!1 &1570625040
GameObject:
m_ObjectHideFlags: 0
@@ -4453,7 +4396,7 @@ RectTransform:
m_Children:
- {fileID: 906197777}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@@ -4472,7 +4415,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 44fbed5ae228de39b9f727def7578d06, type: 3}
m_Name:
m_EditorClassIdentifier:
input: {fileID: 0}
endText: {fileID: 1502459770}
lpmText: {fileID: 1172084829}
lettersRightText: {fileID: 994850063}

View File

@@ -16,8 +16,9 @@ MonoBehaviour:
title: Spelling Bee
description: In deze minigame krijg je verschillende woorden voorgeschoteld die
je zo snel mogelijk moet spellen met behulp van het vingeralfabet
needsTheme: 1
thumbnail: {fileID: 21300000, guid: d99bb2dc44e35344fa358208a01c06c4, type: 3}
minigameEntryPoint: SpellingBee/Scenes/ThemeSelection
minigameEntryPoint: SpellingBee/Scenes/Game
controls: Je begint dit spel met 5 seconden tijd, voor elk juist antwoord krijg
je extra tijd. Hoe sneller je het spel uitspeelt, hoe meer punten je scoort.
Verloopt de timer, dan heb je het spelletje verloren

View File

@@ -6,7 +6,7 @@ using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class GameController : MonoBehaviour
public partial class GameController : MonoBehaviour
{
/// <summary>
/// All of the words that can be used in this session
@@ -125,7 +125,6 @@ public class GameController : MonoBehaviour
/// </summary>
private DateTime startTime;
/// <summary>
/// Reference to the user list to access the current user
/// </summary>
@@ -192,16 +191,6 @@ public class GameController : MonoBehaviour
/// </summary>
public GameObject scoreboardEntry;
/// <summary>
/// Score class TODO: Move to separate file
/// </summary>
[Serializable]
public class Score
{
public int scoreValue;
public string time;
}
/// <summary>
/// Start is called before the first frame update
@@ -331,11 +320,12 @@ public class GameController : MonoBehaviour
if (correctLetters + incorrectLetters > 0)
{
accuracyText.text = ((correctLetters) * 100f / (correctLetters + incorrectLetters)).ToString("#.##") + "%";
} else
}
else
{
accuracyText.text = "-";
}
// Words
wordsText.text = spelledWords.ToString();

View File

@@ -0,0 +1,14 @@
using System;
public partial class GameController
{
/// <summary>
/// Score class TODO: Move to separate file
/// </summary>
[Serializable]
public class Score
{
public int scoreValue;
public string time;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 44c1f8e0fa862b44485ebaa3c81698fc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,19 @@
{
"name": "SpellingBeeScripts",
"rootNamespace": "",
"references": [
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:1631ed2680c61245b8211d943c1639a8",
"GUID:3444c67d5a3a93e5a95a48906078c372",
"GUID:df9d7b70293a2e14d9d3a018c3956f7a"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 49d8025a5c8c313cea12c9a1de36c09b
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,20 +1,31 @@
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
/// <summary>
/// Class to manage all webcam stuff inside the SpellingBee minigame
/// </summary>
public class SpellingBeeWebcam : MonoBehaviour
{
/// <summary>
/// Index of the current camera
/// </summary>
int camdex = 0;
/// <summary>
/// Texture to paste on the display
/// </summary>
WebCamTexture tex;
/// <summary>
/// Display for the video feed
/// </summary>
public RawImage display;
public TextMeshProUGUI dynamic;
/// <summary>
/// Setup the webcam correctly
/// </summary>
void Awake()
{
//popup.SetActive(false);
WebCamDevice device = WebCamTexture.devices[camdex];
tex = new WebCamTexture(device.name);
display.texture = tex;
@@ -22,6 +33,9 @@ public class SpellingBeeWebcam : MonoBehaviour
tex.Play();
}
/// <summary>
/// Swap webcam by cycling through the `WebCamTexture.devices` list
/// </summary>
public void SwapCam()
{
if (WebCamTexture.devices.Length > 0)
@@ -44,33 +58,15 @@ public class SpellingBeeWebcam : MonoBehaviour
}
}
// Scene changing is implemented here to avoid problems with webcam
public void LoadScene(string sceneName)
/// <summary>
/// Scene changing is implemented here to avoid problems with webcam
/// </summary>
public void GotoThemeSelection()
{
display.texture = null;
tex.Stop();
tex = null;
SceneManager.LoadScene(sceneName);
SystemController.GetInstance().BackToPreviousScene();
}
/*
public void Show_feedback(){
if(popup.activeSelf){
dynamic.text = "";
popup.SetActive(false);
return;
}
double index = UnityEngine.Random.value;
if(index < 0.5){
dynamic.text = "Poor";
}
else if(index > 0.8){
dynamic.text = "Excellent";
}
else{
dynamic.text = "Good";
}
popup.SetActive(true);
}
*/
}

View File

@@ -1,27 +0,0 @@
using UnityEngine;
// JSON structure containing all themes/words
[System.Serializable]
public class ThemeList
{
public Theme[] themes;
}
// Object representing part of the JSON containing word data
[System.Serializable]
public class Theme
{
public string name;
public string description;
public string[] words;
}
public class ThemeLoader : MonoBehaviour
{
// Loads the JSON file containing all of the themes
public static ThemeList LoadJson()
{
TextAsset themeJson = Resources.Load<TextAsset>("SpellingBee/words");
return JsonUtility.FromJson<ThemeList>(themeJson.text);
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 68caaa5508a4d40448b47630ff86f035
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"currentUserIndex":0,"storedUsers":[{"username":"testkonijn","avatar":{"instanceID":0},"playtime":0.0,"courses":[{"entries":[{"key":"courseIndex","bytes":[0,1,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,12,2,0,0,0,70,65,115,115,101,109,98,108,121,45,67,83,104,97,114,112,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,5,1,0,0,0,11,67,111,117,114,115,101,73,110,100,101,120,1,0,0,0,7,118,97,108,117,101,95,95,0,8,2,0,0,0,0,0,0,0,11]},{"key":"courseProgress","bytes":[0,1,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,4,1,0,0,0,13,83,121,115,116,101,109,46,83,105,110,103,108,101,1,0,0,0,7,109,95,118,97,108,117,101,0,11,205,204,76,62,11]}]}],"minigames":[{"entries":[{"key":"minigameIndex","bytes":[0,1,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,12,2,0,0,0,70,65,115,115,101,109,98,108,121,45,67,83,104,97,114,112,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,5,1,0,0,0,13,77,105,110,105,103,97,109,101,73,110,100,101,120,1,0,0,0,7,118,97,108,117,101,95,95,0,8,2,0,0,0,0,0,0,0,11]},{"key":"highscore","bytes":[0,1,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,4,1,0,0,0,12,83,121,115,116,101,109,46,73,110,116,51,50,1,0,0,0,7,109,95,118,97,108,117,101,0,8,0,0,0,0,11]},{"key":"scores","bytes":[0,1,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,12,2,0,0,0,70,65,115,115,101,109,98,108,121,45,67,83,104,97,114,112,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,4,1,0,0,0,129,1,83,121,115,116,101,109,46,67,111,108,108,101,99,116,105,111,110,115,46,71,101,110,101,114,105,99,46,76,105,115,116,96,49,91,91,71,97,109,101,67,111,110,116,114,111,108,108,101,114,43,83,99,111,114,101,44,32,65,115,115,101,109,98,108,121,45,67,83,104,97,114,112,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,93,93,3,0,0,0,6,95,105,116,101,109,115,5,95,115,105,122,101,8,95,118,101,114,115,105,111,110,4,0,0,22,71,97,109,101,67,111,110,116,114,111,108,108,101,114,43,83,99,111,114,101,91,93,2,0,0,0,8,8,9,3,0,0,0,10,0,0,0,10,0,0,0,7,3,0,0,0,0,1,0,0,0,10,0,0,0,4,20,71,97,109,101,67,111,110,116,114,111,108,108,101,114,43,83,99,111,114,101,2,0,0,0,9,4,0,0,0,9,5,0,0,0,9,6,0,0,0,9,7,0,0,0,9,8,0,0,0,9,9,0,0,0,9,10,0,0,0,9,11,0,0,0,9,12,0,0,0,9,13,0,0,0,5,4,0,0,0,20,71,97,109,101,67,111,110,116,114,111,108,108,101,114,43,83,99,111,114,101,2,0,0,0,10,115,99,111,114,101,86,97,108,117,101,4,116,105,109,101,0,1,8,2,0,0,0,153,0,0,0,6,14,0,0,0,19,49,48,47,48,51,47,50,48,50,51,32,49,53,58,51,56,58,53,54,1,5,0,0,0,4,0,0,0,17,0,0,0,6,15,0,0,0,19,49,48,47,48,51,47,50,48,50,51,32,49,53,58,51,57,58,53,48,1,6,0,0,0,4,0,0,0,16,0,0,0,6,16,0,0,0,19,49,48,47,48,51,47,50,48,50,51,32,49,55,58,53,51,58,50,50,1,7,0,0,0,4,0,0,0,14,0,0,0,6,17,0,0,0,19,49,48,47,48,51,47,50,48,50,51,32,49,55,58,53,49,58,51,49,1,8,0,0,0,4,0,0,0,12,0,0,0,6,18,0,0,0,19,49,48,47,48,51,47,50,48,50,51,32,49,55,58,50,55,58,48,55,1,9,0,0,0,4,0,0,0,11,0,0,0,6,19,0,0,0,19,49,48,47,48,51,47,50,48,50,51,32,49,53,58,51,51,58,53,48,1,10,0,0,0,4,0,0,0,11,0,0,0,6,20,0,0,0,19,49,48,47,48,51,47,50,48,50,51,32,49,54,58,50,49,58,52,55,1,11,0,0,0,4,0,0,0,11,0,0,0,6,21,0,0,0,19,49,48,47,48,51,47,50,48,50,51,32,49,55,58,51,54,58,50,56,1,12,0,0,0,4,0,0,0,9,0,0,0,6,22,0,0,0,19,49,48,47,48,51,47,50,48,50,51,32,49,55,58,51,48,58,49,56,1,13,0,0,0,4,0,0,0,8,0,0,0,6,23,0,0,0,19,49,48,47,48,51,47,50,48,50,51,32,49,54,58,50,49,58,50,54,11]}]}]}]}

View File

@@ -1,167 +0,0 @@
// Copyright (c) 2021 homuler
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
using NUnit.Framework;
namespace Mediapipe.Tests
{
public class CalculatorGraphTest
{
private const string _ValidConfigText = @"node {
calculator: ""PassThroughCalculator""
input_stream: ""in""
output_stream: ""out1""
}
node {
calculator: ""PassThroughCalculator""
input_stream: ""out1""
output_stream: ""out""
}
input_stream: ""in""
output_stream: ""out""
";
#region Constructor
[Test]
public void Ctor_ShouldInstantiateCalculatorGraph_When_CalledWithNoArguments()
{
Assert.DoesNotThrow(() =>
{
var graph = new CalculatorGraph();
graph.Dispose();
});
}
[Test]
public void Ctor_ShouldInstantiateCalculatorGraph_When_CalledWithConfigText()
{
using (var graph = new CalculatorGraph(_ValidConfigText))
{
var config = graph.Config();
Assert.AreEqual("in", config.InputStream[0]);
Assert.AreEqual("out", config.OutputStream[0]);
}
}
#endregion
#region #isDisposed
[Test]
public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet()
{
using (var graph = new CalculatorGraph())
{
Assert.False(graph.isDisposed);
}
}
[Test]
public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed()
{
var graph = new CalculatorGraph();
graph.Dispose();
Assert.True(graph.isDisposed);
}
#endregion
#region #Initialize
[Test]
public void Initialize_ShouldReturnOk_When_CalledWithConfig_And_ConfigIsNotSet()
{
using (var graph = new CalculatorGraph())
{
using (var status = graph.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ValidConfigText)))
{
Assert.True(status.Ok());
}
var config = graph.Config();
Assert.AreEqual("in", config.InputStream[0]);
Assert.AreEqual("out", config.OutputStream[0]);
}
}
[Test]
public void Initialize_ShouldReturnInternalError_When_CalledWithConfig_And_ConfigIsSet()
{
using (var graph = new CalculatorGraph(_ValidConfigText))
{
using (var status = graph.Initialize(CalculatorGraphConfig.Parser.ParseFromTextFormat(_ValidConfigText)))
{
Assert.AreEqual(Status.StatusCode.Internal, status.Code());
}
}
}
[Test]
public void Initialize_ShouldReturnOk_When_CalledWithConfigAndSidePacket_And_ConfigIsNotSet()
{
using (var sidePacket = new SidePacket())
{
sidePacket.Emplace("flag", new BoolPacket(true));
using (var graph = new CalculatorGraph())
{
var config = CalculatorGraphConfig.Parser.ParseFromTextFormat(_ValidConfigText);
using (var status = graph.Initialize(config, sidePacket))
{
Assert.True(status.Ok());
}
}
}
}
[Test]
public void Initialize_ShouldReturnInternalError_When_CalledWithConfigAndSidePacket_And_ConfigIsSet()
{
using (var sidePacket = new SidePacket())
{
sidePacket.Emplace("flag", new BoolPacket(true));
using (var graph = new CalculatorGraph(_ValidConfigText))
{
var config = CalculatorGraphConfig.Parser.ParseFromTextFormat(_ValidConfigText);
using (var status = graph.Initialize(config, sidePacket))
{
Assert.AreEqual(Status.StatusCode.Internal, status.Code());
}
}
}
}
#endregion
#region lifecycle
[Test]
public void LifecycleMethods_ShouldControlGraphLifeCycle()
{
using (var graph = new CalculatorGraph(_ValidConfigText))
{
Assert.True(graph.StartRun().Ok());
Assert.False(graph.GraphInputStreamsClosed());
Assert.True(graph.WaitUntilIdle().Ok());
Assert.True(graph.CloseAllPacketSources().Ok());
Assert.True(graph.GraphInputStreamsClosed());
Assert.True(graph.WaitUntilDone().Ok());
Assert.False(graph.HasError());
}
}
[Test]
public void Cancel_ShouldCancelGraph()
{
using (var graph = new CalculatorGraph(_ValidConfigText))
{
Assert.True(graph.StartRun().Ok());
graph.Cancel();
Assert.AreEqual(Status.StatusCode.Cancelled, graph.WaitUntilDone().Code());
}
}
#endregion
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 083c8421f4820d09290f0de495a23ec2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,256 +0,0 @@
// Copyright (c) 2021 homuler
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
using NUnit.Framework;
using System;
using System.Linq;
using Unity.Collections;
namespace Mediapipe.Tests
{
public class ImageFrameTest
{
#region Constructor
[Test]
public void Ctor_ShouldInstantiateImageFrame_When_CalledWithNoArguments()
{
using (var imageFrame = new ImageFrame())
{
Assert.AreEqual(ImageFormat.Types.Format.Unknown, imageFrame.Format());
Assert.AreEqual(0, imageFrame.Width());
Assert.AreEqual(0, imageFrame.Height(), 0);
Assert.AreEqual(0, imageFrame.ChannelSize());
Assert.AreEqual(0, imageFrame.NumberOfChannels());
Assert.AreEqual(0, imageFrame.ByteDepth());
Assert.AreEqual(0, imageFrame.WidthStep());
Assert.AreEqual(0, imageFrame.PixelDataSize());
Assert.AreEqual(0, imageFrame.PixelDataSizeStoredContiguously());
Assert.True(imageFrame.IsEmpty());
Assert.False(imageFrame.IsContiguous());
Assert.False(imageFrame.IsAligned(16));
Assert.AreEqual(IntPtr.Zero, imageFrame.MutablePixelData());
}
}
[Test]
public void Ctor_ShouldInstantiateImageFrame_When_CalledWithFormat()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Sbgra, 640, 480))
{
Assert.AreEqual(ImageFormat.Types.Format.Sbgra, imageFrame.Format());
Assert.AreEqual(640, imageFrame.Width());
Assert.AreEqual(480, imageFrame.Height());
Assert.AreEqual(1, imageFrame.ChannelSize());
Assert.AreEqual(4, imageFrame.NumberOfChannels());
Assert.AreEqual(1, imageFrame.ByteDepth());
Assert.AreEqual(640 * 4, imageFrame.WidthStep());
Assert.AreEqual(640 * 480 * 4, imageFrame.PixelDataSize());
Assert.AreEqual(640 * 480 * 4, imageFrame.PixelDataSizeStoredContiguously());
Assert.False(imageFrame.IsEmpty());
Assert.True(imageFrame.IsContiguous());
Assert.True(imageFrame.IsAligned(16));
Assert.AreNotEqual(IntPtr.Zero, imageFrame.MutablePixelData());
}
}
[Test]
public void Ctor_ShouldInstantiateImageFrame_When_CalledWithFormatAndAlignmentBoundary()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 100, 100, 8))
{
Assert.AreEqual(100, imageFrame.Width());
Assert.AreEqual(1, imageFrame.NumberOfChannels());
Assert.AreEqual(104, imageFrame.WidthStep());
}
}
[Test]
public void Ctor_ShouldInstantiateImageFrame_When_CalledWithPixelData()
{
var pixelData = new NativeArray<byte>(32, Allocator.Temp, NativeArrayOptions.UninitializedMemory);
var srcBytes = new byte[] {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
};
pixelData.CopyFrom(srcBytes);
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Sbgra, 4, 2, 16, pixelData))
{
Assert.AreEqual(4, imageFrame.Width());
Assert.AreEqual(2, imageFrame.Height());
Assert.False(imageFrame.IsEmpty());
var bytes = new byte[32];
imageFrame.CopyToBuffer(bytes);
Assert.IsEmpty(bytes.Where((x, i) => x != srcBytes[i]));
}
}
[Test, SignalAbort]
public void Ctor_ShouldThrowMediaPipeException_When_CalledWithInvalidArgument()
{
#pragma warning disable IDE0058
Assert.Throws<MediaPipeException>(() => { new ImageFrame(ImageFormat.Types.Format.Sbgra, 640, 480, 0); });
#pragma warning restore IDE0058
}
#endregion
#region #isDisposed
[Test]
public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet()
{
using (var imageFrame = new ImageFrame())
{
Assert.False(imageFrame.isDisposed);
}
}
[Test]
public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed()
{
var imageFrame = new ImageFrame();
imageFrame.Dispose();
Assert.True(imageFrame.isDisposed);
}
#endregion
#region #SetToZero
[Test]
public void SetToZero_ShouldSetZeroToAllBytes()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10))
{
imageFrame.SetToZero();
var bytes = new byte[100];
imageFrame.CopyToBuffer(bytes);
Assert.True(bytes.All((x) => x == 0));
}
}
#endregion
#region #SetAlignmentPaddingAreas
[Test]
public void SetAlignmentPaddingAreas_ShouldNotThrow()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10, 16))
{
Assert.DoesNotThrow(() => { imageFrame.SetAlignmentPaddingAreas(); });
}
}
#endregion
#region CopyToBuffer
[Test, SignalAbort]
public void CopyToByteBuffer_ShouldThrowException_When_BufferDepthIsWrong()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray16, 10, 10))
{
#pragma warning disable IDE0058
Assert.Throws<MediaPipeException>(() => { imageFrame.CopyToBuffer(new byte[100]); });
#pragma warning restore IDE0058
}
}
[Test]
public void CopyToByteBuffer_ShouldReturnByteArray_When_BufferSizeIsLargeEnough()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10))
{
var normalBuffer = new byte[100];
var largeBuffer = new byte[120];
imageFrame.CopyToBuffer(normalBuffer);
imageFrame.CopyToBuffer(largeBuffer);
Assert.IsEmpty(normalBuffer.Where((x, i) => x != largeBuffer[i]));
}
}
[Test, SignalAbort]
public void CopyToByteBuffer_ShouldThrowException_When_BufferSizeIsTooSmall()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10))
{
#pragma warning disable IDE0058
Assert.Throws<MediaPipeException>(() => { imageFrame.CopyToBuffer(new byte[99]); });
#pragma warning restore IDE0058
}
}
[Test, SignalAbort]
public void CopyToUshortBuffer_ShouldThrowException_When_BufferDepthIsWrong()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10))
{
#pragma warning disable IDE0058
Assert.Throws<MediaPipeException>(() => { imageFrame.CopyToBuffer(new ushort[100]); });
#pragma warning restore IDE0058
}
}
[Test]
public void CopyToUshortBuffer_ShouldReturnUshortArray_When_BufferSizeIsLargeEnough()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray16, 10, 10))
{
var normalBuffer = new ushort[100];
var largeBuffer = new ushort[120];
imageFrame.CopyToBuffer(normalBuffer);
imageFrame.CopyToBuffer(largeBuffer);
Assert.IsEmpty(normalBuffer.Where((x, i) => x != largeBuffer[i]));
}
}
[Test, SignalAbort]
public void CopyToUshortBuffer_ShouldThrowException_When_BufferSizeIsTooSmall()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray16, 10, 10))
{
#pragma warning disable IDE0058
Assert.Throws<MediaPipeException>(() => { imageFrame.CopyToBuffer(new ushort[99]); });
#pragma warning restore IDE0058
}
}
[Test, SignalAbort]
public void CopyToFloatBuffer_ShouldThrowException_When_BufferDepthIsWrong()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Gray8, 10, 10))
{
#pragma warning disable IDE0058
Assert.Throws<MediaPipeException>(() => { imageFrame.CopyToBuffer(new float[100]); });
#pragma warning restore IDE0058
}
}
[Test]
public void CopyToFloatBuffer_ShouldReturnFloatArray_When_BufferSizeIsLargeEnough()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Vec32F1, 10, 10))
{
var normalBuffer = new float[100];
var largeBuffer = new float[120];
imageFrame.CopyToBuffer(normalBuffer);
imageFrame.CopyToBuffer(largeBuffer);
Assert.IsEmpty(normalBuffer.Where((x, i) => Math.Abs(x - largeBuffer[i]) > 1e-9));
}
}
[Test, SignalAbort]
public void CopyToFloatBuffer_ShouldThrowException_When_BufferSizeIsTooSmall()
{
using (var imageFrame = new ImageFrame(ImageFormat.Types.Format.Vec32F1, 10, 10))
{
#pragma warning disable IDE0058
Assert.Throws<MediaPipeException>(() => { imageFrame.CopyToBuffer(new float[99]); });
#pragma warning restore IDE0058
}
}
#endregion
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: efccb8a8c7f87c9629872169190107db
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,132 +0,0 @@
// Copyright (c) 2021 homuler
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
using NUnit.Framework;
using System;
namespace Mediapipe.Tests
{
public class BoolPacketTest
{
#region Constructor
[Test, SignalAbort]
public void Ctor_ShouldInstantiatePacket_When_CalledWithNoArguments()
{
using (var packet = new BoolPacket())
{
#pragma warning disable IDE0058
Assert.AreEqual(Status.StatusCode.Internal, packet.ValidateAsType().Code());
Assert.Throws<MediaPipeException>(() => { packet.Get(); });
Assert.AreEqual(Timestamp.Unset(), packet.Timestamp());
#pragma warning restore IDE0058
}
}
[Test]
public void Ctor_ShouldInstantiatePacket_When_CalledWithTrue()
{
using (var packet = new BoolPacket(true))
{
Assert.True(packet.ValidateAsType().Ok());
Assert.True(packet.Get());
Assert.AreEqual(Timestamp.Unset(), packet.Timestamp());
}
}
[Test]
public void Ctor_ShouldInstantiatePacket_When_CalledWithFalse()
{
using (var packet = new BoolPacket(false))
{
Assert.True(packet.ValidateAsType().Ok());
Assert.False(packet.Get());
Assert.AreEqual(Timestamp.Unset(), packet.Timestamp());
}
}
[Test]
public void Ctor_ShouldInstantiatePacket_When_CalledWithValueAndTimestamp()
{
using (var timestamp = new Timestamp(1))
{
using (var packet = new BoolPacket(true, timestamp))
{
Assert.True(packet.ValidateAsType().Ok());
Assert.True(packet.Get());
Assert.AreEqual(timestamp, packet.Timestamp());
}
}
}
#endregion
#region #isDisposed
[Test]
public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet()
{
using (var packet = new BoolPacket())
{
Assert.False(packet.isDisposed);
}
}
[Test]
public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed()
{
var packet = new BoolPacket();
packet.Dispose();
Assert.True(packet.isDisposed);
}
#endregion
#region #At
[Test]
public void At_ShouldReturnNewPacketWithTimestamp()
{
using (var timestamp = new Timestamp(1))
{
var packet = new BoolPacket(true).At(timestamp);
Assert.True(packet.Get());
Assert.AreEqual(timestamp, packet.Timestamp());
using (var newTimestamp = new Timestamp(2))
{
var newPacket = packet.At(newTimestamp);
Assert.True(newPacket.Get());
Assert.AreEqual(newTimestamp, newPacket.Timestamp());
}
Assert.AreEqual(timestamp, packet.Timestamp());
}
}
#endregion
#region #Consume
[Test]
public void Consume_ShouldThrowNotSupportedException()
{
using (var packet = new BoolPacket())
{
#pragma warning disable IDE0058
Assert.Throws<NotSupportedException>(() => { packet.Consume(); });
#pragma warning restore IDE0058
}
}
#endregion
#region #ValidateAsType
[Test]
public void ValidateAsType_ShouldReturnOk_When_ValueIsSet()
{
using (var packet = new BoolPacket(true))
{
Assert.True(packet.ValidateAsType().Ok());
}
}
#endregion
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: b59151b6708d204ee970450f8028d00b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,137 +0,0 @@
// Copyright (c) 2021 homuler
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
using NUnit.Framework;
using System;
namespace Mediapipe.Tests
{
public class FloatArrayPacketTest
{
#region Constructor
[Test, SignalAbort]
public void Ctor_ShouldInstantiatePacket_When_CalledWithNoArguments()
{
using (var packet = new FloatArrayPacket())
{
#pragma warning disable IDE0058
packet.length = 0;
Assert.AreEqual(Status.StatusCode.Internal, packet.ValidateAsType().Code());
Assert.Throws<MediaPipeException>(() => { packet.Get(); });
Assert.AreEqual(Timestamp.Unset(), packet.Timestamp());
#pragma warning restore IDE0058
}
}
[Test]
public void Ctor_ShouldInstantiatePacket_When_CalledWithEmptyArray()
{
float[] array = { };
using (var packet = new FloatArrayPacket(array))
{
Assert.True(packet.ValidateAsType().Ok());
Assert.AreEqual(array, packet.Get());
Assert.AreEqual(Timestamp.Unset(), packet.Timestamp());
}
}
[Test]
public void Ctor_ShouldInstantiatePacket_When_CalledWithArray()
{
float[] array = { 0.01f };
using (var packet = new FloatArrayPacket(array))
{
Assert.True(packet.ValidateAsType().Ok());
Assert.AreEqual(array, packet.Get());
Assert.AreEqual(Timestamp.Unset(), packet.Timestamp());
}
}
[Test]
public void Ctor_ShouldInstantiatePacket_When_CalledWithValueAndTimestamp()
{
float[] array = { 0.01f, 0.02f };
using (var timestamp = new Timestamp(1))
{
using (var packet = new FloatArrayPacket(array, timestamp))
{
Assert.True(packet.ValidateAsType().Ok());
Assert.AreEqual(array, packet.Get());
Assert.AreEqual(timestamp, packet.Timestamp());
}
}
}
#endregion
#region #isDisposed
[Test]
public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet()
{
using (var packet = new FloatArrayPacket())
{
Assert.False(packet.isDisposed);
}
}
[Test]
public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed()
{
var packet = new FloatArrayPacket();
packet.Dispose();
Assert.True(packet.isDisposed);
}
#endregion
#region #At
[Test]
public void At_ShouldReturnNewPacketWithTimestamp()
{
using (var timestamp = new Timestamp(1))
{
float[] array = { 0.0f };
var packet = new FloatArrayPacket(array).At(timestamp);
Assert.AreEqual(array, packet.Get());
Assert.AreEqual(timestamp, packet.Timestamp());
using (var newTimestamp = new Timestamp(2))
{
var newPacket = packet.At(newTimestamp);
Assert.AreEqual(array, newPacket.Get());
Assert.AreEqual(newTimestamp, newPacket.Timestamp());
}
Assert.AreEqual(timestamp, packet.Timestamp());
}
}
#endregion
#region #Consume
[Test]
public void Consume_ShouldThrowNotSupportedException()
{
using (var packet = new FloatArrayPacket())
{
#pragma warning disable IDE0058
Assert.Throws<NotSupportedException>(() => { packet.Consume(); });
#pragma warning restore IDE0058
}
}
#endregion
#region #ValidateAsType
[Test]
public void ValidateAsType_ShouldReturnOk_When_ValueIsSet()
{
float[] array = { 0.01f };
using (var packet = new FloatArrayPacket(array))
{
Assert.True(packet.ValidateAsType().Ok());
}
}
#endregion
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 43430c0ef642804f9a6347fce4ec497a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,120 +0,0 @@
// Copyright (c) 2021 homuler
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
using NUnit.Framework;
using System;
namespace Mediapipe.Tests
{
public class FloatPacketTest
{
#region Constructor
[Test, SignalAbort]
public void Ctor_ShouldInstantiatePacket_When_CalledWithNoArguments()
{
using (var packet = new FloatPacket())
{
#pragma warning disable IDE0058
Assert.AreEqual(Status.StatusCode.Internal, packet.ValidateAsType().Code());
Assert.Throws<MediaPipeException>(() => { packet.Get(); });
Assert.AreEqual(Timestamp.Unset(), packet.Timestamp());
#pragma warning restore IDE0058
}
}
[Test]
public void Ctor_ShouldInstantiatePacket_When_CalledWithValue()
{
using (var packet = new FloatPacket(0.01f))
{
Assert.True(packet.ValidateAsType().Ok());
Assert.AreEqual(0.01f, packet.Get());
Assert.AreEqual(Timestamp.Unset(), packet.Timestamp());
}
}
[Test]
public void Ctor_ShouldInstantiatePacket_When_CalledWithValueAndTimestamp()
{
using (var timestamp = new Timestamp(1))
{
using (var packet = new FloatPacket(0.01f, timestamp))
{
Assert.True(packet.ValidateAsType().Ok());
Assert.AreEqual(0.01f, packet.Get());
Assert.AreEqual(timestamp, packet.Timestamp());
}
}
}
#endregion
#region #isDisposed
[Test]
public void IsDisposed_ShouldReturnFalse_When_NotDisposedYet()
{
using (var packet = new FloatPacket())
{
Assert.False(packet.isDisposed);
}
}
[Test]
public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed()
{
var packet = new FloatPacket();
packet.Dispose();
Assert.True(packet.isDisposed);
}
#endregion
#region #At
[Test]
public void At_ShouldReturnNewPacketWithTimestamp()
{
using (var timestamp = new Timestamp(1))
{
var packet = new FloatPacket(0).At(timestamp);
Assert.AreEqual(0.0f, packet.Get());
Assert.AreEqual(timestamp, packet.Timestamp());
using (var newTimestamp = new Timestamp(2))
{
var newPacket = packet.At(newTimestamp);
Assert.AreEqual(0.0f, newPacket.Get());
Assert.AreEqual(newTimestamp, newPacket.Timestamp());
}
Assert.AreEqual(timestamp, packet.Timestamp());
}
}
#endregion
#region #Consume
[Test]
public void Consume_ShouldThrowNotSupportedException()
{
using (var packet = new FloatPacket())
{
#pragma warning disable IDE0058
Assert.Throws<NotSupportedException>(() => { packet.Consume(); });
#pragma warning restore IDE0058
}
}
#endregion
#region #ValidateAsType
[Test]
public void ValidateAsType_ShouldReturnOk_When_ValueIsSet()
{
using (var packet = new FloatPacket(0.01f))
{
Assert.True(packet.ValidateAsType().Ok());
}
}
#endregion
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 39a81137616a1218b9b2b11d2feeadd0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More