Sprint 4
This commit is contained in:
@@ -20,6 +20,7 @@ public class Course : ScriptableObject
|
||||
/// <summary>
|
||||
/// A short description of the course
|
||||
/// </summary>
|
||||
[TextArea]
|
||||
public string description;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
/// <summary>
|
||||
/// Enum for easy indexing and checking if a course is of a certain kind
|
||||
/// </summary>
|
||||
public enum CourseIndex
|
||||
{
|
||||
FINGERSPELLING,
|
||||
CLOTHING,
|
||||
ANIMALS,
|
||||
FOOD,
|
||||
HOBBIES,
|
||||
HOUSE,
|
||||
FAMILY
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using UnityEngine;
|
||||
/// <summary>
|
||||
/// Keep track of all courses
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "Create new Scriptable/CourseList")]
|
||||
[CreateAssetMenu(menuName = "Create new Scriptable/Course List")]
|
||||
public class CourseList : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "InterfacesScripts",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:5c2b5ba89f9e74e418232e154bc5cc7a"
|
||||
"GUID:d23f64cfd3b314bb4a18a8284c99bf5e",
|
||||
"GUID:e83ddf9a537a96b4a804a16bb7872ec1"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f2d0ee6dd21e1d4eb25b71b7a749d25
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
|
||||
@@ -18,6 +18,16 @@ public class Learnable
|
||||
/// </summary>
|
||||
public Sprite image;
|
||||
|
||||
/// <summary>
|
||||
/// Sprite of the hand gesture used for fingerspelling
|
||||
/// </summary>
|
||||
public Sprite handGuide = null;
|
||||
|
||||
/// <summary>
|
||||
/// Addaptive threshold
|
||||
/// </summary>
|
||||
public float thresholdPercentage = 0.90f;
|
||||
|
||||
/// <summary>
|
||||
/// Example video clip
|
||||
/// </summary>
|
||||
|
||||
@@ -19,6 +19,7 @@ public class Minigame : ScriptableObject
|
||||
/// <summary>
|
||||
/// A short description of the minigame
|
||||
/// </summary>
|
||||
[TextArea]
|
||||
public string description;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
/// <summary>
|
||||
/// Enum for easy indexing and checking if a minigame is of a certain kind
|
||||
/// </summary>
|
||||
public enum MinigameIndex
|
||||
{
|
||||
SPELLING_BEE,
|
||||
HANGMAN,
|
||||
JUST_SIGN
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 97282ff3b465e3c4682d218b3819b2e8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
/// <summary>
|
||||
/// Keep track off installed minigames
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "Create new Scriptable/MinigameList")]
|
||||
[CreateAssetMenu(menuName = "Create new Scriptable/Minigame List")]
|
||||
public class MinigameList : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
@@ -33,7 +33,7 @@ public class MinigameList : ScriptableObject
|
||||
/// </summary>
|
||||
/// <param name="title"></param>
|
||||
public void SetCurrentMinigame(MinigameIndex index)
|
||||
{
|
||||
{
|
||||
currentMinigameIndex = minigames.FindIndex((mi) => mi.index == index);
|
||||
}
|
||||
}
|
||||
|
||||
9
Assets/Common/Interfaces/ModelIndex.cs
Normal file
9
Assets/Common/Interfaces/ModelIndex.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <summary>
|
||||
/// This enum is used to identify each of the SignLanguage models
|
||||
/// </summary>
|
||||
public enum ModelIndex
|
||||
{
|
||||
NONE,
|
||||
FINGERSPELLING,
|
||||
BASIC_SIGNS
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16056ca3e1523f78cbd727cea2bfe047
|
||||
guid: 6dbd5e1100bc81648b52206df369d0a1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
82
Assets/Common/Interfaces/ModelList.cs
Normal file
82
Assets/Common/Interfaces/ModelList.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
using NatML;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
/// <summary>
|
||||
/// This scriptable will hold tupples of Courseindices and models
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "Create new Scriptable/ModelList")]
|
||||
public class ModelList : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Small class to link a model to a courseIndex irrespective of its position in a list
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ModelTuple
|
||||
{
|
||||
/// <summary>
|
||||
/// ModelIndex to which the model corresponds
|
||||
/// </summary>
|
||||
public ModelIndex index;
|
||||
/// <summary>
|
||||
/// The model itself
|
||||
/// </summary>
|
||||
public MLModelData modelWINDOWS;
|
||||
/// <summary>
|
||||
/// The model itself
|
||||
/// </summary>
|
||||
public MLModelData modelMAC;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A list of all the models
|
||||
/// </summary>
|
||||
public List<ModelTuple> models = new List<ModelTuple>();
|
||||
|
||||
/// <summary>
|
||||
/// Index of the currently active model
|
||||
/// </summary>
|
||||
public int currentModelIndex = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Get a model by modelindex
|
||||
/// </summary>
|
||||
/// <param name="modelIndex">ModelIndex of the model</param>
|
||||
/// <returns>Model associated with this index, null if no model was found</returns>
|
||||
public MLModelData GetCurrentModel()
|
||||
{
|
||||
|
||||
// Select Model based on OS
|
||||
#if (UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
|
||||
return models.Find(x => x.modelWINDOWS == models[currentModelIndex].modelWINDOWS)?.modelWINDOWS;
|
||||
#elif (UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX)
|
||||
return models.Find(x => x.modelMAC == models[currentModelIndex].modelMAC)?.modelMAC;
|
||||
#endif
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Function to check if the modelIndex has been set
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool HasValidModel()
|
||||
{
|
||||
return models[currentModelIndex].index != (int)ModelIndex.NONE;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Function to find a model-index in the list based on its index
|
||||
/// </summary>
|
||||
/// <param name="title"></param>
|
||||
public void SetCurrentModel(ModelIndex index)
|
||||
{
|
||||
currentModelIndex = models.FindIndex((m) => m.index == index);
|
||||
}
|
||||
|
||||
public ModelIndex GetCurrentModelIndex()
|
||||
{
|
||||
return models[currentModelIndex].index;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5bf21dee022ed0489face1c734359de
|
||||
guid: 78a3f61c93a08c04496c49ffd10b9021
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Score class
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class Score
|
||||
{
|
||||
public int scoreValue;
|
||||
public string time;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Unity.Barracuda;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
@@ -16,17 +15,19 @@ public class Theme : ScriptableObject
|
||||
/// <summary>
|
||||
/// A short description of the theme
|
||||
/// </summary>
|
||||
[TextArea]
|
||||
public string description;
|
||||
|
||||
/// <summary>
|
||||
/// Index of the theme
|
||||
/// </summary>
|
||||
public ThemeIndex index;
|
||||
public ThemeIndex themeIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the model used in the SignPredictor
|
||||
/// The index of the model you want to use
|
||||
/// </summary>
|
||||
public NNModel model;
|
||||
public ModelIndex modelIndex;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// List of all learnable words/letters
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
|
||||
/// <summary>
|
||||
/// Enum for easy indexing and checking if a course is of a certain kind
|
||||
/// </summary>
|
||||
public enum ThemeIndex
|
||||
{
|
||||
SIGN_ALPHABET,
|
||||
SIGN_CLOTHING,
|
||||
SIGN_ANIMALS,
|
||||
SIGN_FOOD,
|
||||
SIGN_HOBBIES,
|
||||
SIGN_HOUSE,
|
||||
SIGN_FAMILY,
|
||||
SPELLING_GEOGRAPY,
|
||||
SPELLING_BUILDINGS,
|
||||
SPELLING_SPORTS,
|
||||
SPELLING_BASICS,
|
||||
SPELLING_HOBBIES,
|
||||
SPELLING_PEOPLE,
|
||||
SPELLING_FRUIT,
|
||||
SPELLING_VEGGIES,
|
||||
SPELLING_WILD,
|
||||
SPELLING_FARM
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 58e9afcf842bdfa48939e754bb39182a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
/// <summary>
|
||||
/// Keep track off defined themes
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "Create new Scriptable/ThemeList")]
|
||||
[CreateAssetMenu(menuName = "Create new Scriptable/Theme List")]
|
||||
public class ThemeList : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,6 +24,6 @@ public class ThemeList : ScriptableObject
|
||||
/// <param name="title"></param>
|
||||
public void SetCurrentTheme(ThemeIndex index)
|
||||
{
|
||||
this.currentThemeIndex = themes.FindIndex((mi) => mi.index == index);
|
||||
this.currentThemeIndex = themes.FindIndex((mi) => mi.themeIndex == index);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user